Set queried object on CPT archives. Fixes #15730

git-svn-id: https://develop.svn.wordpress.org/trunk@16792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-12-08 08:57:38 +00:00
parent d5717c050c
commit cae6e8d4ef
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -2675,6 +2675,8 @@ class WP_Query {
$this->queried_object = $term;
$this->queried_object_id = (int) $term->term_id;
}
} elseif ( $this->is_post_type_archive ) {
$this->queried_object = get_post_type_object( $this->get('post_type') );
} elseif ( $this->is_posts_page ) {
$page_for_posts = get_option('page_for_posts');
$this->queried_object = & get_page( $page_for_posts );