Check that ancestors are not the currently queried objects in nav menu classes. props filosofo, fixes #14518.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-05 04:29:56 +00:00
parent e291e5010d
commit 42394406c1
1 changed files with 4 additions and 2 deletions

View File

@ -411,14 +411,16 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
'post_type' == $parent_item->type &&
! empty( $queried_object->post_type ) &&
is_post_type_hierarchical( $queried_object->post_type ) &&
in_array( $parent_item->object_id, $queried_object->ancestors )
in_array( $parent_item->object_id, $queried_object->ancestors ) &&
$parent_item->object != $queried_object->ID
) ||
// ancestral term
(
'taxonomy' == $parent_item->type &&
isset( $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] )
in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
$parent_item->object_id != $queried_object->term_id
)
)
) {