Make WordPress Core


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

Ensure that the post type object is the queried object when a post type has been registered with has_archive => true. Ensure it is not stomped when decorated with tax_query. Adds unit tests.

Props nacin.
Fixes #18614.

File:
1 edited

Legend:

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

    r25289 r25291  
    31483148     */
    31493149    function is_post_type_archive( $post_types = '' ) {
    3150         if ( empty( $post_types ) || !$this->is_post_type_archive )
     3150        if ( empty( $post_types ) || ! $this->is_post_type_archive )
    31513151            return (bool) $this->is_post_type_archive;
    31523152
    3153         $post_type_object = $this->get_queried_object();
     3153        $post_type_object = get_post_type_object( $this->get( 'post_type' ) );
    31543154
    31553155        return in_array( $post_type_object->name, (array) $post_types );
Note: See TracChangeset for help on using the changeset viewer.