Used By
| Used By | Description |
|---|---|
| wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::prepare_item_for_response() | Prepares a single comment output for response. |
Checks comment_approved to set comment status for single comment output.
(string|int) (Required) comment status.
(string) Comment status.
File: wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
protected function prepare_status_response( $comment_approved ) {
switch ( $comment_approved ) {
case 'hold':
case '0':
$status = 'hold';
break;
case 'approve':
case '1':
$status = 'approved';
break;
case 'spam':
case 'trash':
default:
$status = $comment_approved;
break;
}
return $status;
} | Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_comments_controller/prepare_status_response