Minor cleanup in queried object setting logic. See #14590

git-svn-id: http://svn.automattic.com/wordpress/trunk@16543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-11-23 00:47:45 +00:00
parent 53a2e0667e
commit 696bfb5fc6
1 changed files with 4 additions and 9 deletions

View File

@ -2679,19 +2679,14 @@ class WP_Query {
$page_for_posts = get_option('page_for_posts');
$this->queried_object = & get_page( $page_for_posts );
$this->queried_object_id = (int) $this->queried_object->ID;
} elseif ( $this->is_single && !is_null($this->post) ) {
$this->queried_object = $this->post;
$this->queried_object_id = (int) $this->post->ID;
} elseif ( $this->is_page && !is_null($this->post) ) {
} elseif ( $this->is_singular && !is_null($this->post) ) {
$this->queried_object = $this->post;
$this->queried_object_id = (int) $this->post->ID;
} elseif ( $this->is_author ) {
$author_id = (int) $this->get('author');
$author = get_userdata($author_id);
$this->queried_object = $author;
$this->queried_object_id = $author_id;
$this->queried_object_id = (int) $this->get('author');
$this->queried_object = get_userdata( $this->queried_object_id );
}
debug($this->is_attachment, $this->is_page, $this->is_single);
return $this->queried_object;
}