Classes for posts and terms in the menus. see #13379

git-svn-id: https://develop.svn.wordpress.org/trunk@14891 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-05-25 16:51:09 +00:00
parent e964603b5e
commit ca7b6498d7
1 changed files with 6 additions and 1 deletions

View File

@ -70,7 +70,12 @@ class Walker_Nav_Menu extends Walker {
$classes = $value = ''; $classes = $value = '';
$classes = array( 'menu-item', 'menu-item-type-'. $item->type, $item->classes, 'menu-item-object-'. $item->object ); $classes = array( 'menu-item', 'menu-item-type-' . $item->type, $item->classes );
if ( 'custom' != $item->type ) {
$classes[] = 'menu-item-object-' . $item->object;
$classes[] = 'menu-item-object-' . $item->type . '-' . $item->object_id;
}
$classes = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $classes = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$classes = ' class="' . esc_attr( $classes ) . '"'; $classes = ' class="' . esc_attr( $classes ) . '"';