mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
@@ -72,6 +72,21 @@ function get_archive_template() {
|
||||
return get_query_template( 'archive', $templates );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve path of post type archive template in current or parent template.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_post_type_archive_template() {
|
||||
$obj = get_post_type_object( get_query_var( 'post_type' ) );
|
||||
if ( ! $obj->has_archive )
|
||||
return '';
|
||||
|
||||
return get_archive_template();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve path of author template in current or parent template.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user