Make WordPress Core

Changeset 16731


Ignore:
Timestamp:
12/05/2010 04:29:56 AM (14 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu-template.php

    r16520 r16731  
    412412                    ! empty( $queried_object->post_type ) &&
    413413                    is_post_type_hierarchical( $queried_object->post_type ) &&
    414                     in_array( $parent_item->object_id, $queried_object->ancestors )
     414                    in_array( $parent_item->object_id, $queried_object->ancestors ) &&
     415                    $parent_item->object != $queried_object->ID
    415416                ) ||
    416417
     
    419420                    'taxonomy' == $parent_item->type &&
    420421                    isset( $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
    421                     in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] )
     422                    in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
     423                    $parent_item->object_id != $queried_object->term_id
    422424                )
    423425            )
Note: See TracChangeset for help on using the changeset viewer.