woocommerce_rest_prepare_customer_download filter-hookWC 1.0

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

WC_REST_Customer_Downloads_V2_Controller::prepare_item_for_response()
woocommerce_rest_prepare_customer_download
WC_REST_Customer_Downloads_V1_Controller::prepare_item_for_response()
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 );

Where the hook is used in WooCommerce

Usage not found.