From b33c95079b7fe3e1fc60b0d82a882573480a2a62 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 4 Jun 2014 23:43:15 +0000 Subject: [PATCH] Avoid a PHP notice when using WP_Query::get_queried_object() in pre_get_posts action. props wpsmith. fixes #28412. Built from https://develop.svn.wordpress.org/trunk@28667 git-svn-id: http://core.svn.wordpress.org/trunk@28485 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index dbec6e1dc4..1fab7a2b6b 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3723,7 +3723,7 @@ class WP_Query { $page_for_posts = get_option('page_for_posts'); $this->queried_object = get_post( $page_for_posts ); $this->queried_object_id = (int) $this->queried_object->ID; - } elseif ( $this->is_singular && !is_null($this->post) ) { + } elseif ( $this->is_singular && ! empty( $this->post ) ) { $this->queried_object = $this->post; $this->queried_object_id = (int) $this->post->ID; } elseif ( $this->is_author ) {