From 0f31b1da726c9d7a308b69b0c37ccc61289b1f42 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 19 Nov 2016 00:10:31 +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. Built from https://develop.svn.wordpress.org/trunk@39305 git-svn-id: http://core.svn.wordpress.org/trunk@39245 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-comments-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 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 c8efdf1683..a04ec8234a 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 @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 30c24936d7..d4b5104a05 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39304'; +$wp_version = '4.7-beta4-39305'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.