Proper checks for current-menu-item. props duck_, fixes #13409.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8b523fad45
commit
231be64801
|
@ -79,7 +79,11 @@ class Walker_Nav_Menu extends Walker {
|
||||||
$classes[] = 'current-menu-item';
|
$classes[] = 'current-menu-item';
|
||||||
} else {
|
} else {
|
||||||
$classes[] = 'menu-item-object-'. $item->object;
|
$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';
|
$classes[] = 'current-menu-item';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue