From b7ac72a92b3d1b556a531560f671e5ad94c148d2 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 22 Jun 2010 22:05:43 +0000 Subject: [PATCH] Assign menu-item-home also when menu item isn't current. props filosofo, see #14053 for trunk. git-svn-id: http://svn.automattic.com/wordpress/trunk@15302 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index d2fb493b8f..b127cada63 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -363,7 +363,6 @@ function _wp_menu_item_classes_by_context( &$menu_items ) { } if ( untrailingslashit($current_url) == home_url() ) { - $classes[] = 'menu-item-home'; // Back compat for home limk to match wp_page_menu() $classes[] = 'current_page_item'; } @@ -371,6 +370,9 @@ function _wp_menu_item_classes_by_context( &$menu_items ) { $active_parent_object_ids[] = (int) $menu_item->post_parent; $active_object = $menu_item->object; } + + if ( untrailingslashit($item_url) == home_url() ) + $classes[] = 'menu-item-home'; } // back-compat with wp_page_menu: add "current_page_parent" to static home page link for any non-page query