WordPress.org

Make WordPress Core

Ticket #16347: 16347.diff

File 16347.diff, 605 bytes (added by nacin, 7 years ago)

Untested

  • wp-includes/query.php

     
    29662966                if ( empty( $post_types ) || !$this->is_post_type_archive )
    29672967                        return (bool) $this->is_post_type_archive;
    29682968
    2969                 if ( ! isset( $this->posts[0] ) )
    2970                         return false;
     2969                $post_type_object = $wp_query->get_queried_object();
    29712970
    2972                 $post = $this->posts[0];
    2973 
    2974                 return in_array( $post->post_type, (array) $post_types );
     2971                return in_array( $post_type_object->post_type, (array) $post_types );
    29752972        }
    29762973
    29772974        /**