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: https://develop.svn.wordpress.org/trunk@22302 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-10-25 20:32:01 +00:00
parent 208e916374
commit 80a1e11ab0
1 changed files with 1 additions and 1 deletions

View File

@ -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';