From 0c14c16ced2251237066c5fc324a48569d120c74 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Fri, 18 Nov 2016 20:20:32 +0000 Subject: [PATCH] REST API: Clarify parameters when used in error strings. Properties of objects should not be translated, and therefore are pulled out of the translation strings. Props ocean90, ramiy, danielbachhuber. Fixes #38822. Built from https://develop.svn.wordpress.org/trunk@39298 git-svn-id: http://core.svn.wordpress.org/trunk@39238 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../endpoints/class-wp-rest-comments-controller.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 09223c06b9..d90b949244 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -373,11 +373,13 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { // Limit who can set comment `author` or `status` to anything other than the default. if ( isset( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( 'moderate_comments' ) ) { - return new WP_Error( 'rest_comment_invalid_author', __( 'Comment author invalid.' ), array( 'status' => rest_authorization_required_code() ) ); + /* translators: %s: request parameter */ + return new WP_Error( 'rest_comment_invalid_author', sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author' ), array( 'status' => rest_authorization_required_code() ) ); } if ( isset( $request['status'] ) && ! current_user_can( 'moderate_comments' ) ) { - return new WP_Error( 'rest_comment_invalid_status', __( 'Sorry, you are not allowed to set status for comments.' ), array( 'status' => rest_authorization_required_code() ) ); + /* translators: %s: request parameter */ + return new WP_Error( 'rest_comment_invalid_status', sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'status' ), array( 'status' => rest_authorization_required_code() ) ); } if ( empty( $request['post'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 160aba2845..070f4b66f5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39297'; +$wp_version = '4.7-beta4-39298'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.