Check that ancestors are not the currently queried objects in nav menu classes. props filosofo, fixes #14518.
git-svn-id: https://develop.svn.wordpress.org/trunk@16731 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7e29ed550e
commit
63b4617b98
@ -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
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user