diff --git a/wp-includes/meta.php b/wp-includes/meta.php index c203c535e4..3da7542ada 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -115,6 +115,7 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v // expected_slashed ($meta_key) $meta_key = stripslashes($meta_key); + $passed_value = $meta_value; $meta_value = stripslashes_deep($meta_value); $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type ); @@ -123,7 +124,7 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v return (bool) $check; if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) ) - return add_metadata($meta_type, $object_id, $meta_key, $meta_value); + return add_metadata($meta_type, $object_id, $meta_key, $passed_value); // Compare existing value to new value if no prev value given and the key exists only once. if ( empty($prev_value) ) {