mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Text Changes: Merge some duplicate strings with the same meaning in error messages, adjust some other strings for consistency and accuracy.
Props ramiy, SergeyBiryukov. Fixes #38808. git-svn-id: https://develop.svn.wordpress.org/trunk@39278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -285,7 +285,7 @@ class WP_REST_Server {
|
||||
|
||||
$jsonp_callback = $_GET['_jsonp'];
|
||||
if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) {
|
||||
echo $this->json_error( 'rest_callback_invalid', __( 'The JSONP callback function is invalid.' ), 400 );
|
||||
echo $this->json_error( 'rest_callback_invalid', __( 'Invalid JSONP callback function.' ), 400 );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
* comment_content. See wp_handle_comment_submission().
|
||||
*/
|
||||
if ( empty( $prepared_comment['comment_content'] ) ) {
|
||||
return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) );
|
||||
return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
// Setting remaining values before wp_insert_comment so we can use wp_allow_comment().
|
||||
@@ -637,7 +637,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) {
|
||||
return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) );
|
||||
return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
$prepared_args['comment_ID'] = $id;
|
||||
|
||||
@@ -126,7 +126,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
$post_type = get_post_type_object( $this->post_type );
|
||||
|
||||
if ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) {
|
||||
return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit these posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -458,7 +458,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! current_user_can( $post_type->cap->create_posts ) ) {
|
||||
return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create new posts.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create posts as this user.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
if ( ! $this->check_assign_terms_permission( $request ) ) {
|
||||
@@ -708,7 +708,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
$post = get_post( $request['id'] );
|
||||
|
||||
if ( $post && ! $this->check_delete_permission( $post ) ) {
|
||||
return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete posts.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this post.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -546,7 +546,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'delete_term', $term->term_id ) ) {
|
||||
return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete resource.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this resource.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -823,7 +823,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'link' => array(
|
||||
'description' => __( 'URL to the resource.' ),
|
||||
'description' => __( 'URL of the resource.' ),
|
||||
'type' => 'string',
|
||||
'format' => 'uri',
|
||||
'context' => array( 'view', 'embed', 'edit' ),
|
||||
|
||||
@@ -387,7 +387,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
public function create_item_permissions_check( $request ) {
|
||||
|
||||
if ( ! current_user_can( 'create_users' ) ) {
|
||||
return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create resource.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new resource.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -543,7 +543,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( email_exists( $request['email'] ) && $request['email'] !== $user->user_email ) {
|
||||
return new WP_Error( 'rest_user_invalid_email', __( 'Email address is invalid.' ), array( 'status' => 400 ) );
|
||||
return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) {
|
||||
@@ -551,7 +551,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) {
|
||||
return new WP_Error( 'rest_user_invalid_slug', __( 'Slug is invalid.' ), array( 'status' => 400 ) );
|
||||
return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
if ( ! empty( $request['roles'] ) ) {
|
||||
@@ -1139,7 +1139,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
'context' => array( 'embed', 'view', 'edit' ),
|
||||
),
|
||||
'link' => array(
|
||||
'description' => __( 'Author URL to the resource.' ),
|
||||
'description' => __( 'Author URL of the resource.' ),
|
||||
'type' => 'string',
|
||||
'format' => 'uri',
|
||||
'context' => array( 'embed', 'view', 'edit' ),
|
||||
|
||||
Reference in New Issue
Block a user