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

git-svn-id: https://develop.svn.wordpress.org/trunk@23867 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-03-29 16:37:46 +00:00
parent 729396af3a
commit 1a96cb8355

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 );
}