Ensure sticky posts are WP_Post objects. props mdawaffe. see #21309.
git-svn-id: https://develop.svn.wordpress.org/trunk@21569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4a10a8eac2
commit
29cfcf3b63
|
@ -2750,7 +2750,7 @@ class WP_Query {
|
||||||
// Ignore sticky posts the current user cannot read or are not published.
|
// Ignore sticky posts the current user cannot read or are not published.
|
||||||
if ( 'publish' != $sticky_post->post_status )
|
if ( 'publish' != $sticky_post->post_status )
|
||||||
continue;
|
continue;
|
||||||
array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
|
array_splice($this->posts, $sticky_offset, 0, array( get_post( $sticky_post ) ) );
|
||||||
$sticky_offset++;
|
$sticky_offset++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue