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:
parent
729396af3a
commit
1a96cb8355
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user