woocommerce_rest_prepare_data_currency filter-hookWC 1.0

Filter currency returned from the API.

Usage

add_filter( 'woocommerce_rest_prepare_data_currency', 'wp_kama_woocommerce_rest_prepare_data_currency_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_data_currency` filter-hook.
 * 
 * @param WP_REST_Response $response The response object.
 * @param array            $item     Currency data.
 * @param WP_REST_Request  $request  Request used to generate the response.
 *
 * @return WP_REST_Response
 */
function wp_kama_woocommerce_rest_prepare_data_currency_filter( $response, $item, $request ){

	// filter...
	return $response;
}
$response(WP_REST_Response)
The response object.
$item(array)
Currency data.
$request(WP_REST_Request)
Request used to generate the response.

Where the hook is called

WC_REST_Data_Currencies_Controller::prepare_item_for_response()
woocommerce_rest_prepare_data_currency
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-currencies-controller.php 169
return apply_filters( 'woocommerce_rest_prepare_data_currency', $response, $item, $request );

Where the hook is used in WooCommerce

Usage not found.