From d087812e088c589e748a40412cd6a21574f3ec8f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 18 Nov 2016 23:52:21 +0000 Subject: [PATCH] REST API: Merge two similar permission error strings. Props ramiy. Fixes #38857. git-svn-id: https://develop.svn.wordpress.org/trunk@39304 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/endpoints/class-wp-rest-post-types-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-taxonomies-controller.php | 2 +- .../rest-api/endpoints/class-wp-rest-users-controller.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php index 3f11048786..5492317bf7 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php @@ -127,7 +127,7 @@ class WP_REST_Post_Types_Controller extends WP_REST_Controller { } if ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) { - return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) ); } $data = $this->prepare_item_for_response( $obj, $request ); diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php index 899706ae89..d25c347ca5 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php @@ -141,7 +141,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller { return false; } if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->manage_terms ) ) { - return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage this resource.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) ); } } diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php index 9fdfeaf6a7..298f8e7855 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php @@ -515,7 +515,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller { $id = (int) $request['id']; if ( ! current_user_can( 'edit_user', $id ) ) { - return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit resource.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this resource.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['roles'] ) && ! current_user_can( 'edit_users' ) ) {