From 0b3c278d631c0c1d85d5b3e52586225028ba59fd Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 1 Aug 2008 03:50:20 +0000 Subject: [PATCH] Make sure meta is added to the post, not a revision. git-svn-id: https://develop.svn.wordpress.org/trunk@8513 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 1fa9d183ae..3c4bdebf13 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -511,6 +511,10 @@ function get_posts($args = null) { function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { global $wpdb; + // make sure meta is added to the post, not a revision + if ( $the_post = wp_is_post_revision($post_id) ) + $post_id = $the_post; + // expected_slashed ($meta_key) $meta_key = stripslashes($meta_key);