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:
nacin 2010-05-23 22:01:08 +00:00
parent 8b523fad45
commit 231be64801
1 changed files with 5 additions and 1 deletions

View File

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