Skip to content

Instantly share code, notes, and snippets.

@rolandinsh
Forked from jmdodd/gist:1139941
Created February 14, 2013 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolandinsh/4951696 to your computer and use it in GitHub Desktop.
Save rolandinsh/4951696 to your computer and use it in GitHub Desktop.
<?php
if ( ! function_exists( 'ucc_nav_menu_css_class' ) ) {
function ucc_nav_menu_css_class( $classes, $item, $args ) {
$class = sanitize_title( $item->title );
$classes[] = 'menu-item-' . $class;
return $classes;
} }
add_filter( 'nav_menu_css_class', 'ucc_nav_menu_css_class', 10, 3 );
/*
Copyright 2011 Jennifer M. Dodd (email: jmdodd@gmail.com)
Released under the GPLv2 (or later).
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment