Update get_queried_object() to use get_userdata() when retrieving authors. fixes #2044
git-svn-id: http://svn.automattic.com/wordpress/trunk@3290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
931ee9ff74
commit
93cd8402f2
|
@ -734,11 +734,10 @@ class WP_Query {
|
||||||
$this->queried_object = $this->post;
|
$this->queried_object = $this->post;
|
||||||
$this->queried_object_id = $this->post->ID;
|
$this->queried_object_id = $this->post->ID;
|
||||||
} else if ($this->is_author) {
|
} else if ($this->is_author) {
|
||||||
global $cache_userdata;
|
$author_id = $this->get('author');
|
||||||
if (isset($cache_userdata[$this->get('author')])) {
|
$author = get_userdata($author_id);
|
||||||
$this->queried_object = $cache_userdata[$this->get('author')];
|
$this->queried_object = $author;
|
||||||
$this->queried_object_id = $this->get('author');
|
$this->queried_object_id = $author_id;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->queried_object;
|
return $this->queried_object;
|
||||||
|
|
Loading…
Reference in New Issue