WC_REST_Customer_Downloads_V1_Controller::get_items()
Get all customer downloads.
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)
- -
WC_REST_Customer_Downloads_V1_Controller::get_items() WC REST Customer Downloads V1 Controller::get items code WC 9.8.1
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 ); }