Make sure meta is added to the post, not a revision.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fddd74d5b9
commit
4d78593e80
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue