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: http://core.svn.wordpress.org/trunk@22244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-10-16 13:48:07 +00:00
parent 59d096e270
commit 2c0d4f8ebf
1 changed files with 1 additions and 1 deletions

View File

@ -2725,7 +2725,7 @@ class WP_Query {
} }
if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) 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 // Put sticky posts at the top of the posts array