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
This commit is contained in:
parent
9cb0a09d1f
commit
0f31b1da72
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue