Make sure the autosave post exists before getting its meta. props kovshenin. fixes #23539.

git-svn-id: http://core.svn.wordpress.org/trunk@23867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-03-29 16:37:46 +00:00
parent 48f5701214
commit 90dd5c458e
1 changed files with 3 additions and 0 deletions

View File

@ -535,6 +535,9 @@ function _wp_preview_meta_filter( $value, $object_id, $meta_key, $single ) {
return $value;
$preview = wp_get_post_autosave( $post->ID );
if ( ! is_object( $preview ) )
return $value;
return get_post_meta( $preview->ID, $meta_key, $single );
}