From 696bfb5fc6e205bec6b830ac3b91071b8f1c9992 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: http://svn.automattic.com/wordpress/trunk@16543 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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; }