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

Filter a report returned from the API.

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

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

add_filter( 'woocommerce_rest_prepare_report_coupons_count', 'wp_kama_woocommerce_rest_prepare_report_coupons_count_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_report_coupons_count` 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_coupons_count_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.

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

WC_REST_Report_Coupons_Totals_Controller::prepare_item_for_response()
woocommerce_rest_prepare_report_coupons_count
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-report-coupons-totals-controller.php 106
return apply_filters( 'woocommerce_rest_prepare_report_coupons_count', $response, $report, $request );

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

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