From 33b2fbc7e784df55d8e66e1eb0a9031f447d4e75 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 26 Jul 2019 13:20:56 +0000 Subject: [PATCH] REST API: Make "Could not update meta value in database" error messages more helpful. Props apermo, AkSDvP. Fixes #46252. Built from https://develop.svn.wordpress.org/trunk@45681 git-svn-id: http://core.svn.wordpress.org/trunk@45492 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/fields/class-wp-rest-meta-fields.php | 9 ++++++--- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) 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 a24a5f649c..9cfee2ee71 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 @@ -267,7 +267,8 @@ abstract class WP_REST_Meta_Fields { if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', - __( 'Could not update meta value in database.' ), + /* translators: %s: custom field key */ + sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, @@ -280,7 +281,8 @@ abstract class WP_REST_Meta_Fields { if ( ! add_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', - __( 'Could not update meta value in database.' ), + /* translators: %s: custom field key */ + sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, @@ -330,7 +332,8 @@ abstract class WP_REST_Meta_Fields { if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', - __( 'Could not update meta value in database.' ), + /* translators: %s: custom field key */ + sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, diff --git a/wp-includes/version.php b/wp-includes/version.php index 8e13a36621..8fa43ba17d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45680'; +$wp_version = '5.3-alpha-45681'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.