woocommerce_rest_prepare_customer_download
Filter customer download data returned from the REST API.
Usage
add_filter( 'woocommerce_rest_prepare_customer_download', 'wp_kama_woocommerce_rest_prepare_customer_download_filter', 10, 3 ); /** * Function for `woocommerce_rest_prepare_customer_download` filter-hook. * * @param WP_REST_Response $response The response object. * @param stdClass $download Download object used to create response. * @param WP_REST_Request $request Request object. * * @return WP_REST_Response */ function wp_kama_woocommerce_rest_prepare_customer_download_filter( $response, $download, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $download(stdClass)
- Download object used to create response.
- $request(WP_REST_Request)
- Request object.
Where the hook is called
woocommerce_rest_prepare_customer_download
woocommerce_rest_prepare_customer_download
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customer-downloads-v2-controller.php 66
return apply_filters( 'woocommerce_rest_prepare_customer_download', $response, $download, $request );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-customer-downloads-v1-controller.php 131
return apply_filters( 'woocommerce_rest_prepare_customer_download', $response, $download, $request );