From 86da62e436f50628a2fc1eeddcfea76f889e51e1 Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 23 Nov 2010 00:47:45 +0000 Subject: [PATCH] Minor cleanup in queried object setting logic. See #14590 git-svn-id: https://develop.svn.wordpress.org/trunk@16543 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 9bf4faa3ab..caf5b07eef 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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; }