From a0a36d35c99ecab48ef7a11debf644b9018536f9 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@21073 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 dc56be47e9..5f6ccddfb8 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2673,7 +2673,7 @@ class WP_Query { // 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 ) {