mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-23 16:01:37 +01:00
No need for by-reference when calculating the queried object in PHP5. props SergeyBiryukov, duck_, fixes #20039.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dad05727fc
commit
256747055b
@ -1624,7 +1624,7 @@ class WP_Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( '' != $qv['pagename'] ) {
|
if ( '' != $qv['pagename'] ) {
|
||||||
$this->queried_object =& get_page_by_path($qv['pagename']);
|
$this->queried_object = get_page_by_path($qv['pagename']);
|
||||||
if ( !empty($this->queried_object) )
|
if ( !empty($this->queried_object) )
|
||||||
$this->queried_object_id = (int) $this->queried_object->ID;
|
$this->queried_object_id = (int) $this->queried_object->ID;
|
||||||
else
|
else
|
||||||
@ -2977,7 +2977,7 @@ class WP_Query {
|
|||||||
$this->queried_object = get_post_type_object( $this->get('post_type') );
|
$this->queried_object = get_post_type_object( $this->get('post_type') );
|
||||||
} elseif ( $this->is_posts_page ) {
|
} elseif ( $this->is_posts_page ) {
|
||||||
$page_for_posts = get_option('page_for_posts');
|
$page_for_posts = get_option('page_for_posts');
|
||||||
$this->queried_object = & get_page( $page_for_posts );
|
$this->queried_object = get_page( $page_for_posts );
|
||||||
$this->queried_object_id = (int) $this->queried_object->ID;
|
$this->queried_object_id = (int) $this->queried_object->ID;
|
||||||
} elseif ( $this->is_singular && !is_null($this->post) ) {
|
} elseif ( $this->is_singular && !is_null($this->post) ) {
|
||||||
$this->queried_object = $this->post;
|
$this->queried_object = $this->post;
|
||||||
|
Loading…
Reference in New Issue
Block a user