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

git-svn-id: https://develop.svn.wordpress.org/trunk@11644 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-06-26 06:19:54 +00:00
parent efcea18935
commit ffef1c0d4c
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);