|
@@ 363-365 (lines=3) @@
|
| 360 |
|
return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to read this comment.' ), array( 'status' => rest_authorization_required_code() ) ); |
| 361 |
|
} |
| 362 |
|
|
| 363 |
|
if ( $post && ! $this->check_read_post_permission( $post, $request ) ) { |
| 364 |
|
return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); |
| 365 |
|
} |
| 366 |
|
|
| 367 |
|
return true; |
| 368 |
|
} |
|
@@ 468-470 (lines=3) @@
|
| 465 |
|
return new WP_Error( 'rest_comment_trash_post', __( 'Sorry, you are not allowed to create a comment on this post.' ), array( 'status' => 403 ) ); |
| 466 |
|
} |
| 467 |
|
|
| 468 |
|
if ( ! $this->check_read_post_permission( $post, $request ) ) { |
| 469 |
|
return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); |
| 470 |
|
} |
| 471 |
|
|
| 472 |
|
if ( ! comments_open( $post->ID ) ) { |
| 473 |
|
return new WP_Error( 'rest_comment_closed', __( 'Sorry, comments are closed for this item.' ), array( 'status' => 403 ) ); |