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', 'filter_function_name_1802', 10, 3 ); function filter_function_name_1802( $response, $data, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $data(stdClass)
- The original report object.
- $request(WP_REST_Request)
- Request used to generate the response.
Где вызывается хук
woocommerce_rest_prepare_report_sales
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 );