WC_REST_Product_Reviews_Controller::get_item()
Get a single product review.
Method of the class: WC_REST_Product_Reviews_Controller{}
No Hooks.
Return
WP_Error|WP_REST_Response
.
Usage
$WC_REST_Product_Reviews_Controller = new WC_REST_Product_Reviews_Controller(); $WC_REST_Product_Reviews_Controller->get_item( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
WC_REST_Product_Reviews_Controller::get_item() WC REST Product Reviews Controller::get item code WC 9.2.3
public function get_item( $request ) { $review = $this->get_review( $request['id'] ); if ( is_wp_error( $review ) ) { return $review; } $data = $this->prepare_item_for_response( $review, $request ); $response = rest_ensure_response( $data ); return $response; }