You are here

function om_tools_class_safe in OM Tools 8.2

Same name and namespace in other branches
  1. 8 om_tools.module \om_tools_class_safe()
  2. 6.2 inc/om_tools.utils.inc \om_tools_class_safe()
  3. 6 om_tools.module \om_tools_class_safe()
  4. 7.2 inc/om_tools.utils.inc \om_tools_class_safe()
  5. 7 om_tools.module \om_tools_class_safe()

Safe classes

3 calls to om_tools_class_safe()
om_block_classes_get in tools/block/block.inc
default blocks classes
om_menu_classes_get in tools/menu/menu.inc
default menus classes
om_node_preprocess_html in tools/node/node.inc
Override or insert om variables into the templates.

File

inc/om_tools.utils.inc, line 73
OM Tools Admin Utilities

Code

function om_tools_class_safe($string) {

  // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
  $string = preg_replace('/-/', ' ', $string);
  $string = trim(preg_replace('/\\s+/', ' ', $string));
  return strtolower(preg_replace('/[^a-zA-Z0-9-]+/', '-', $string));
}