WC_REST_Product_Attributes_V1_Controller::get_item() public WC 1.0
Get a single attribute.
{} It's a method of the class: WC_REST_Product_Attributes_V1_Controller{}
No Hooks.
Return
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.
Code of WC_REST_Product_Attributes_V1_Controller::get_item() WC REST Product Attributes V1 Controller::get item WC 5.0.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 );
}