From f8becb79f796e4f3e715898813cede77dee5b824 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 25 Oct 2012 20:32:01 +0000 Subject: [PATCH] Confirm that the nav menu's underlying object is in the proper taxonomy before adding the current-menu-item class. props SergeyBiryukov. fixes #21369. git-svn-id: http://core.svn.wordpress.org/trunk@22302 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 1146429ec4..df5612d225 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -337,7 +337,7 @@ function _wp_menu_item_classes_by_context( &$menu_items ) { ( ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id ) || ( 'post_type' == $menu_item->type && $wp_query->is_singular ) || - ( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) ) + ( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) && $queried_object->taxonomy == $menu_item->object ) ) ) { $classes[] = 'current-menu-item';