WC_REST_Customer_Downloads_V1_Controller::get_items() public WC 1.0
Get all customer downloads.
{} It's a method of the class: WC_REST_Customer_Downloads_V1_Controller{}
No Hooks.
Return
Array.
Usage
$WC_REST_Customer_Downloads_V1_Controller = new WC_REST_Customer_Downloads_V1_Controller(); $WC_REST_Customer_Downloads_V1_Controller->get_items( $request );
- $request(WP_REST_Request) (required)
- -
Code of WC_REST_Customer_Downloads_V1_Controller::get_items() WC REST Customer Downloads V1 Controller::get items WC 5.0.0
public function get_items( $request ) {
$downloads = wc_get_customer_available_downloads( (int) $request['customer_id'] );
$data = array();
foreach ( $downloads as $download_data ) {
$download = $this->prepare_item_for_response( (object) $download_data, $request );
$download = $this->prepare_response_for_collection( $download );
$data[] = $download;
}
return rest_ensure_response( $data );
}