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

Filter the location list returned from the API.

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

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

add_filter( 'woocommerce_rest_prepare_data_continent', 'wp_kama_woocommerce_rest_prepare_data_continent_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_data_continent` filter-hook.
 * 
 * @param WP_REST_Response $response The response object.
 * @param array            $item     The original list of continent(s), countries, and states.
 * @param WP_REST_Request  $request  Request used to generate the response.
 *
 * @return WP_REST_Response
 */
function wp_kama_woocommerce_rest_prepare_data_continent_filter( $response, $item, $request ){

	// filter...
	return $response;
}
$response(WP_REST_Response)
The response object.
$item(массив)
The original list of continent(s), countries, and states.
$request(WP_REST_Request)
Request used to generate the response.

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

WC_REST_Data_Continents_Controller::prepare_item_for_response()
woocommerce_rest_prepare_data_continent
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-continents-controller.php 219
return apply_filters( 'woocommerce_rest_prepare_data_continent', $response, $item, $request );

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

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