Make WordPress Core


Ignore:
Timestamp:
09/06/2013 11:38:51 PM (11 years ago)
Author:
wonderboymusic
Message:

Check the value passed to get_post_type_object(). If it's an array, use the first item. get_query_var( 'post_type' ) can be an array if the query has been altered via filters/actions. There are several places in core that pass the query var. Adds unit tests.

In template-loader.php, move is_post_type_archive() and is_tax() directly below is_home().

See #18614, [25291].

File:
1 edited

Legend:

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

    r25271 r25292  
    10581058function get_post_type_object( $post_type ) {
    10591059    global $wp_post_types;
     1060
     1061    if ( is_array( $post_type ) )
     1062        $post_type = reset( $post_type );
    10601063
    10611064    if ( empty($wp_post_types[$post_type]) )
Note: See TracChangeset for help on using the changeset viewer.