Don't show error message when updating a custom field without changing its value. see #10254 for 2.8.1

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@11645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-06-26 06:20:27 +00:00
parent cdccf9cf7c
commit 85c711e5e7
1 changed files with 4 additions and 2 deletions

View File

@ -814,8 +814,10 @@ case 'add-meta' :
die('0'); // if meta doesn't exist
if ( !current_user_can( 'edit_post', $meta->post_id ) )
die('-1');
if ( !$u = update_meta( $mid, $key, $value ) )
die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
if ( $meta->meta_value != stripslashes($value) ) {
if ( !$u = update_meta( $mid, $key, $value ) )
die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
}
$key = stripslashes($key);
$value = stripslashes($value);