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:
parent
e964603b5e
commit
ca7b6498d7
|
@ -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 ) . '"';
|
||||||
|
|
Loading…
Reference in New Issue