Call _get_post_ancestors() from get_post_ancestors() if the ancestors property is not set in the post object. Works around situations where ancestors is not set in the cached version of the post object. see #18536

git-svn-id: https://develop.svn.wordpress.org/trunk@20171 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-03-12 18:23:48 +00:00
parent 0459805741
commit 1a41092158
2 changed files with 7 additions and 4 deletions

View File

@@ -2671,7 +2671,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]);
$status = get_post_status($this->posts[0]->ID);
$post_status_obj = get_post_status_object($status);
//$type = get_post_type($this->posts[0]);
if ( !$post_status_obj->public ) {