From b61f722856bbeda90523d75c9b4484e11db55a72 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 19 Nov 2016 00:09:07 +0000 Subject: [PATCH] REST API: Merge two similar permission error strings in `class-wp-rest-comments-controller.php`. We're checking if `current_user_can( 'moderate_comments' )` here, not the specific comment permissions. See #38857. git-svn-id: https://develop.svn.wordpress.org/trunk@39305 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/endpoints/class-wp-rest-comments-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index c8efdf1683..a04ec8234a 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -320,7 +320,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { } if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { - return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view this comment with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); + return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view comments with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); } return true;