woocommerce_rest_prepare_report_sales хук-фильтрWC 1.0

Filter a report sales returned from the API.

Allows modification of the report sales data right before it is returned.


add_filter( 'woocommerce_rest_prepare_report_sales', 'wp_kama_woocommerce_rest_prepare_report_sales_filter', 10, 3 );

 * Function for `woocommerce_rest_prepare_report_sales` filter-hook.
 * @param WP_REST_Response $response The response object.
 * @param stdClass         $data     The original report object.
 * @param WP_REST_Request  $request  Request used to generate the response.
 * @return WP_REST_Response
function wp_kama_woocommerce_rest_prepare_report_sales_filter( $response, $data, $request ){

	// filter...
	return $response;
The response object.
The original report object.
Request used to generate the response.

Где вызывается хук

woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-report-sales-v1-controller.php 237
return apply_filters( 'woocommerce_rest_prepare_report_sales', $response, (object) $sales_data, $request );

Где используется хук в WooCommerce

Использование не найдено.