mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@25291 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3147,10 +3147,10 @@ class WP_Query {
|
||||
* @return bool
|
||||
*/
|
||||
function is_post_type_archive( $post_types = '' ) {
|
||||
if ( empty( $post_types ) || !$this->is_post_type_archive )
|
||||
if ( empty( $post_types ) || ! $this->is_post_type_archive )
|
||||
return (bool) $this->is_post_type_archive;
|
||||
|
||||
$post_type_object = $this->get_queried_object();
|
||||
$post_type_object = get_post_type_object( $this->get( 'post_type' ) );
|
||||
|
||||
return in_array( $post_type_object->name, (array) $post_types );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user