function om_tools_class_safe in OM Tools 7.2
Same name and namespace in other branches
- 8.2 inc/om_tools.utils.inc \om_tools_class_safe()
- 8 om_tools.module \om_tools_class_safe()
- 6.2 inc/om_tools.utils.inc \om_tools_class_safe()
- 6 om_tools.module \om_tools_class_safe()
- 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 75 - 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));
}