woocommerce_rest_prepare_data_download_ip
Filter the list returned from the API.
Использование
add_filter( 'woocommerce_rest_prepare_data_download_ip', 'wp_kama_woocommerce_rest_prepare_data_download_ip_filter', 10, 3 ); /** * Function for `woocommerce_rest_prepare_data_download_ip` filter-hook. * * @param WP_REST_Response $response The response object. * @param array $item The original item. * @param WP_REST_Request $request Request used to generate the response. * * @return WP_REST_Response */ function wp_kama_woocommerce_rest_prepare_data_download_ip_filter( $response, $item, $request ){ // filter... return $response; }
- $response(WP_REST_Response)
- The response object.
- $item(массив)
- The original item.
- $request(WP_REST_Request)
- Request used to generate the response.
Где вызывается хук
woocommerce_rest_prepare_data_download_ip
woocommerce/src/Admin/API/DataDownloadIPs.php 110
return apply_filters( 'woocommerce_rest_prepare_data_download_ip', $response, $item, $request );