From f3f3886b6ce0f9cdf2a663c450a1ddb8593bd799 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 24 Nov 2008 17:04:14 +0000 Subject: WP Merge with revision 9860 git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1542 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/post.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'wp-includes/post.php') diff --git a/wp-includes/post.php b/wp-includes/post.php index 54ce668..0a580f9 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -549,7 +549,9 @@ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { function delete_post_meta($post_id, $key, $value = '') { global $wpdb; - $post_id = absint( $post_id ); + // 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 ($key, $value) $key = stripslashes( $key ); @@ -630,6 +632,10 @@ function get_post_meta($post_id, $key, $single = false) { function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') { 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); -- cgit