mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
Minor cleanup in queried object setting logic. See #14590
git-svn-id: https://develop.svn.wordpress.org/trunk@16543 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cf21cf2a89
commit
86da62e436
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user