Make WordPress Core


Ignore:
Timestamp:
09/10/2013 03:01:10 AM (12 years ago)
Author:
wonderboymusic
Message:

Move checks for post_type being an array inline. See [25291], [25292], #18614.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r25311 r25312  
    30773077            }
    30783078        } elseif ( $this->is_post_type_archive ) {
    3079             $this->queried_object = get_post_type_object( $this->get('post_type') );
     3079            $post_type = $this->get( 'post_type' );
     3080            if ( is_array( $post_type ) )
     3081                $post_type = reset( $post_type );
     3082            $this->queried_object = get_post_type_object( $post_type );
    30803083        } elseif ( $this->is_posts_page ) {
    30813084            $page_for_posts = get_option('page_for_posts');
     
    31533156            return (bool) $this->is_post_type_archive;
    31543157
    3155         $post_type_object = get_post_type_object( $this->get( 'post_type' ) );
     3158        $post_type = $this->get( 'post_type' );
     3159        if ( is_array( $post_type ) )
     3160            $post_type = reset( $post_type );
     3161        $post_type_object = get_post_type_object( $post_type );
    31563162
    31573163        return in_array( $post_type_object->name, (array) $post_types );
Note: See TracChangeset for help on using the changeset viewer.