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
This commit is contained in:
parent
fac0ce8ec7
commit
f8becb79f7
|
@ -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 ) ||
|
( ! 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 ) ||
|
( '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';
|
$classes[] = 'current-menu-item';
|
||||||
|
|
Loading…
Reference in New Issue