From 42394406c1459b5593925d2de812662ed1a54e57 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 5 Dec 2010 04:29:56 +0000 Subject: [PATCH] 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 --- wp-includes/nav-menu-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index fc3e33cdea..3d15070844 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -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 ) ) ) {