Make WordPress Core


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.

File:
1 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';
Note: See TracChangeset for help on using the changeset viewer.