if ( !$meta = get_post_meta_by_id( $id ) )
die('1');
- if ( !current_user_can( 'edit_post', $meta->post_id ) )
+ if ( !current_user_can( 'edit_post', $meta->post_id ) || is_protected_meta( $meta->meta_key ) )
die('-1');
if ( delete_meta( $meta->meta_id ) )
die('1');
die('0'); // if meta doesn't exist
if ( !current_user_can( 'edit_post', $meta->post_id ) )
die('-1');
+ if ( is_protected_meta( $meta->meta_key ) )
+ die('-1');
if ( $meta->meta_value != stripslashes($value) || $meta->meta_key != stripslashes($key) ) {
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).