WC_REST_Product_Attributes_V1_Controller::get_item
Get a single attribute.
Method of the class: WC_REST_Product_Attributes_V1_Controller{}
No Hooks.
Returns
WP_REST_Request|WP_Error.
Usage
$WC_REST_Product_Attributes_V1_Controller = new WC_REST_Product_Attributes_V1_Controller(); $WC_REST_Product_Attributes_V1_Controller->get_item( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
WC_REST_Product_Attributes_V1_Controller::get_item() WC REST Product Attributes V1 Controller::get item code WC 10.7.0
public function get_item( $request ) {
$attribute = $this->get_attribute( (int) $request['id'] );
if ( is_wp_error( $attribute ) ) {
return $attribute;
}
$response = $this->prepare_item_for_response( $attribute, $request );
return rest_ensure_response( $response );
}