diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index 78cef6f910..817f5c106a 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -232,6 +232,10 @@ abstract class WP_REST_Meta_Fields { ); } + if ( null === get_metadata_raw( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { + return true; + } + if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { return new WP_Error( 'rest_meta_database_error', diff --git a/wp-includes/version.php b/wp-includes/version.php index 120ddf8a81..038069612b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50566'; +$wp_version = '5.8-alpha-50567'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.