woocommerce_rest_prepare_report_variations
Filter a report returned from the API.
Allows modification of the report data right before it is returned.
Использование
add_filter( 'woocommerce_rest_prepare_report_variations', 'wp_kama_woocommerce_rest_prepare_report_variations_filter', 10, 3 ); /** * Function for `woocommerce_rest_prepare_report_variations` filter-hook. * * @param WP_REST_Response $response The response object. * @param object $report 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_variations_filter( $response, $report, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $report(объект)
- The original report object.
- $request(WP_REST_Request)
- Request used to generate the response.
Список изменений
С версии 6.5.0 | Введена. |
Где вызывается хук
woocommerce/src/Admin/API/Reports/Variations/Controller.php 89
return apply_filters( 'woocommerce_rest_prepare_report_variations', $response, $report, $request );