Don't assume queried object is a term. Fixes non-existent var notice. Props filosofo. fixes #15944
git-svn-id: https://develop.svn.wordpress.org/trunk@17109 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ef34db239b
commit
48a0f157b1
@ -426,9 +426,12 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
|
||||
'taxonomy' == $parent_item->type &&
|
||||
isset( $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
|
||||
in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
|
||||
(
|
||||
! isset( $queried_object->term_id ) ||
|
||||
$parent_item->object_id != $queried_object->term_id
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
$classes[] = empty( $queried_object->taxonomy ) ? 'current-' . $queried_object->post_type . '-ancestor' : 'current-' . $queried_object->taxonomy . '-ancestor';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user