woocommerce_rest_prepare_data_country хук-фильтр . WC 1.0
Filter the states list for a country returned from the API.
Allows modification of the loction data right before it is returned.
Использование
add_filter( 'woocommerce_rest_prepare_data_country', 'filter_function_name_9952', 10, 3 ); function filter_function_name_9952( $response, $data, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $data(массив)
- The original country's states list.
- $request(WP_REST_Request)
- Request used to generate the response.
Где вызывается хук
woocommerce_rest_prepare_data_country
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-countries-controller.php 166
return apply_filters( 'woocommerce_rest_prepare_data_country', $response, $item, $request );