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

git-svn-id: http://svn.automattic.com/wordpress/trunk@14891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-05-25 16:51:09 +00:00
parent 98f19bc328
commit 31b8da5ae5
1 changed files with 6 additions and 1 deletions

View File

@ -70,7 +70,12 @@ class Walker_Nav_Menu extends Walker {
$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 = ' class="' . esc_attr( $classes ) . '"';