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
This commit is contained in:
Andrew Ozz 2008-08-01 03:50:20 +00:00
parent 90e3261fd9
commit 0b3c278d63
1 changed files with 4 additions and 0 deletions

View File

@ -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);