Changeset 21559 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 08/20/2012 07:47:52 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r21553 r21559 3222 3222 $term = get_term($term->parent, $object_type); 3223 3223 } 3224 } elseif ( null !== get_post_type_object( $object_type ) ) { 3225 $object = get_post($object_id); 3226 if ( ! is_wp_error( $object ) && isset( $object->ancestors ) && is_array( $object->ancestors ) ) 3227 $ancestors = $object->ancestors; 3228 else { 3229 while ( ! is_wp_error($object) && ! empty( $object->post_parent ) && ! in_array( $object->post_parent, $ancestors ) ) { 3230 $ancestors[] = (int) $object->post_parent; 3231 $object = get_post($object->post_parent); 3232 } 3233 } 3224 } elseif ( post_type_exists( $object_type ) ) { 3225 $ancestors = get_post_ancestors($object_id); 3234 3226 } 3235 3227
Note: See TracChangeset
for help on using the changeset viewer.