mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
Proper checks for current-menu-item. props duck_, fixes #13409.
git-svn-id: https://develop.svn.wordpress.org/trunk@14824 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f7b7608131
commit
ec0823ce3e
@ -79,7 +79,11 @@ class Walker_Nav_Menu extends Walker {
|
||||
$classes[] = 'current-menu-item';
|
||||
} else {
|
||||
$classes[] = 'menu-item-object-'. $item->object;
|
||||
if ( $item->object_id == $wp_query->get_queried_object_id() )
|
||||
if (
|
||||
$item->object_id == $wp_query->get_queried_object_id() &&
|
||||
( ( 'post_type' == $item->type && $wp_query->is_singular ) ||
|
||||
( 'taxonomy' == $item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) ) )
|
||||
)
|
||||
$classes[] = 'current-menu-item';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user