Prevent PHP Notices on 404 pages
git-svn-id: http://svn.automattic.com/wordpress/trunk@13691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5f8dc97924
commit
c4d0bd8f0c
|
@ -2665,7 +2665,7 @@ class WP_Query {
|
||||||
} elseif ( $this->is_posts_page ) {
|
} elseif ( $this->is_posts_page ) {
|
||||||
$this->queried_object = & get_page(get_option('page_for_posts'));
|
$this->queried_object = & get_page(get_option('page_for_posts'));
|
||||||
$this->queried_object_id = (int) $this->queried_object->ID;
|
$this->queried_object_id = (int) $this->queried_object->ID;
|
||||||
} elseif ( $this->is_single ) {
|
} elseif ( $this->is_single && !is_null($this->post) ) {
|
||||||
$this->queried_object = $this->post;
|
$this->queried_object = $this->post;
|
||||||
$this->queried_object_id = (int) $this->post->ID;
|
$this->queried_object_id = (int) $this->post->ID;
|
||||||
} elseif ( $this->is_page && !is_null($this->post) ) {
|
} elseif ( $this->is_page && !is_null($this->post) ) {
|
||||||
|
|
Loading…
Reference in New Issue