diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index eb90e762f5663..c38bab1f52c59 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2613,6 +2613,12 @@ function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) { * An empty string if a valid but non-existing post ID is passed and `$single` is true. */ function get_post_meta( $post_id, $key = '', $single = false ) { + // Make sure meta is get for the post, not for a revision. + $the_post = wp_is_post_revision( $post_id ); + if ( $the_post ) { + $post_id = $the_post; + } + return get_metadata( 'post', $post_id, $key, $single ); }