From 29cfcf3b635f0bee5081431582a6f5f6b50944f1 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 21 Aug 2012 04:04:54 +0000 Subject: [PATCH] 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 --- 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 39168345b6..e249ec2ee3 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2750,7 +2750,7 @@ class WP_Query { // Ignore sticky posts the current user cannot read or are not published. if ( 'publish' != $sticky_post->post_status ) 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++; } }