From 31b8da5ae5042dc795686ee2026fe2bed740a551 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 25 May 2010 16:51:09 +0000 Subject: [PATCH] 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 --- wp-includes/nav-menu-template.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 3b225a6a69..6f5061536d 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -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 ) . '"';