Make WordPress Core

Changeset 14155


Ignore:
Timestamp:
04/18/2010 03:54:45 PM (16 years ago)
Author:
nacin
Message:

Use is_post_type_hierarchical and is_taxonomy_hierarchical when we're fetching a post/tax object only to check the hierarchical flag. fixes #12950.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r14147 r14155  
    269269                        if ( empty($terms) )
    270270                                continue;
    271                         $taxonomy = get_taxonomy( $tax_name );
    272                         if ( $taxonomy->hierarchical )
     271                        if ( is_taxonomy_hierarchical( $tax_name ) )
    273272                                $tax_input[$tax_name] = array_map( 'absint', $terms );
    274273                        else {
     
    317316                foreach ( $tax_names as $tax_name ) {
    318317                        if( isset( $tax_input[$tax_name])  ) {
    319                                 $taxonomy = get_taxonomy( $tax_name );
    320                                 if( $taxonomy->hierarchical )
     318                                if ( is_taxonomy_hierarchical( $tax_name ) )
    321319                                        $terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') );
    322320                                else
     
    862860        else
    863861                $post_type = 'post';
    864         $post_type_object = get_post_type_object($post_type);
    865862
    866863        $avail_post_stati = get_available_post_statuses($post_type);
     
    892889
    893890        // Hierarchical types require special args.
    894         if ( $post_type_object->hierarchical ) {
     891        if ( is_post_type_hierarchical( $post_type ) ) {
    895892                $query['orderby'] = 'menu_order title';
    896893                $query['order'] = 'asc';
  • trunk/wp-includes/post.php

    r14133 r14155  
    25112511        // Hierarchical taxonomies must always pass IDs rather than names so that children with the same
    25122512        // names but different parents aren't confused.
    2513         $taxonomy_obj = get_taxonomy( $taxonomy );
    2514         if ( $taxonomy_obj->hierarchical ) {
     2513        if ( is_taxonomy_hierarchical( $taxonomy ) ) {
    25152514                $tags = array_map( 'intval', $tags );
    25162515                $tags = array_unique( $tags );
  • trunk/wp-includes/rewrite.php

    r13774 r14155  
    14371437                                        foreach ( get_post_types( array('_builtin' => false ) ) as $ptype ) {
    14381438                                                if ( strpos($struct, "%$ptype%") !== false ) {
    1439                                                         $ptype = get_post_type_object($ptype);
    14401439                                                        $post = true;
    1441                                                         $page = $ptype->hierarchical; // This is for page style attachment url's
     1440                                                        $page = is_post_type_hierarchical( $ptype ); // This is for page style attachment url's
    14421441                                                        break;
    14431442                                                }
Note: See TracChangeset for help on using the changeset viewer.