From 8142f2eb366af7b544a78d436b9a431278f454da Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 Jun 2012 23:09:27 +0000 Subject: [PATCH] Pass a post object instead of ID to help preserve ancestors. Props duck_. fixes #18536 git-svn-id: http://core.svn.wordpress.org/trunk@21073 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 dc56be47e95a..5f6ccddfb8a1 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2673,7 +2673,7 @@ function &get_posts() { // Check post status to determine if post should be displayed. if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { - $status = get_post_status($this->posts[0]->ID); + $status = get_post_status($this->posts[0]); $post_status_obj = get_post_status_object($status); //$type = get_post_type($this->posts[0]); if ( !$post_status_obj->public ) {