WC_REST_Product_Reviews_Controller::prepare_status_response() protected WC 3.5.0
Checks comment_approved to set comment status for single comment output.
{} It's a method of the class: WC_REST_Product_Reviews_Controller{}
No Hooks.
Return
String. Comment status.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_status_response( $comment_approved );
- $comment_approved(string|int) (required)
- comment status.
Changelog
Since 3.5.0 | Introduced. |
Code of WC_REST_Product_Reviews_Controller::prepare_status_response() WC REST Product Reviews Controller::prepare status response WC 5.0.0
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;
}