From 10677cdac858e5ee077f4df8c8fa8a4cbecb5bf4 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 16 Oct 2012 13:48:07 +0000 Subject: [PATCH] Pass the result of the the_preview filter through get_post() to ensure the post is filtered and of type WP_Post. fixes #22162 git-svn-id: https://develop.svn.wordpress.org/trunk@22244 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 9ab77b02f4..c48452d67b 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2725,7 +2725,7 @@ class WP_Query { } if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) - $this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this )); + $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) ); } // Put sticky posts at the top of the posts array