mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
e291e5010d
commit
42394406c1
@ -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