Make WordPress Core


Ignore:
Timestamp:
09/10/2013 03:01:10 AM (13 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/general-template.php

    r25310 r25312  
    580580        // If there's a post type archive
    581581        if ( is_post_type_archive() ) {
    582                 $post_type_object = get_post_type_object( get_query_var( 'post_type' ) );
     582                $post_type = get_query_var( 'post_type' );
     583                if ( is_array( $post_type ) )
     584                        $post_type = reset( $post_type );
     585                $post_type_object = get_post_type_object( $post_type );
    583586                if ( ! $post_type_object->has_archive )
    584587                        $title = post_type_archive_title( '', false );
     
    707710                return;
    708711
    709         $post_type_obj = get_post_type_object( get_query_var( 'post_type' ) );
     712        $post_type = get_query_var( 'post_type' );
     713        if ( is_array( $post_type ) )
     714                $post_type = reset( $post_type );
     715
     716        $post_type_obj = get_post_type_object( $post_type );
    710717        $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
    711718
     
    16901697                }
    16911698        } elseif ( is_post_type_archive() ) {
    1692                 $post_type_obj = get_post_type_object( get_query_var( 'post_type' ) );
     1699                $post_type = get_query_var( 'post_type' );
     1700                if ( is_array( $post_type ) )
     1701                        $post_type = reset( $post_type );
     1702
     1703                $post_type_obj = get_post_type_object( $post_type );
    16931704                $title = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );
    16941705                $href = get_post_type_archive_feed_link( $post_type_obj->name );
Note: See TracChangeset for help on using the changeset viewer.