Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Inconsistancy in add/get/update/delete_post_meta() functions #5216

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from
6 changes: 6 additions & 0 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
Loading