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 bfa3159..e4e1be4 100644
|
a
|
b
|
class WP_REST_Comments_Controller extends WP_REST_Controller { |
| 373 | 373 | |
| 374 | 374 | // Limit who can set comment `author` or `status` to anything other than the default. |
| 375 | 375 | if ( isset( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( 'moderate_comments' ) ) { |
| 376 | | return new WP_Error( 'rest_comment_invalid_author', __( 'Comment author invalid.' ), array( 'status' => rest_authorization_required_code() ) ); |
| | 376 | /* translators: %s: request parameter */ |
| | 377 | return new WP_Error( 'rest_comment_invalid_author', sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author' ), array( 'status' => rest_authorization_required_code() ) ); |
| 377 | 378 | } |
| 378 | 379 | |
| 379 | 380 | if ( isset( $request['status'] ) && ! current_user_can( 'moderate_comments' ) ) { |
| 380 | | return new WP_Error( 'rest_comment_invalid_status', __( 'Sorry, you are not allowed to set status for comments.' ), array( 'status' => rest_authorization_required_code() ) ); |
| | 381 | /* translators: %s: request parameter */ |
| | 382 | return new WP_Error( 'rest_comment_invalid_status', sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'status' ), array( 'status' => rest_authorization_required_code() ) ); |
| 381 | 383 | } |
| 382 | 384 | |
| 383 | 385 | if ( empty( $request['post'] ) ) { |