woocommerce_rest_prepare_tax filter-hookWC 1.0

Filter tax object returned from the REST API.

Usage

add_filter( 'woocommerce_rest_prepare_tax', 'wp_kama_woocommerce_rest_prepare_tax_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_tax` filter-hook.
 * 
 * @param WP_REST_Response $response  The response object.
 * @param stdClass         $tax_class Tax object used to create response.
 * @param WP_REST_Request  $request   Request object.
 *
 * @return WP_REST_Response
 */
function wp_kama_woocommerce_rest_prepare_tax_filter( $response, $tax_class, $request ){

	// filter...
	return $response;
}
$response(WP_REST_Response)
The response object.
$tax_class(stdClass)
Tax object used to create response.
$request(WP_REST_Request)
Request object.

Where the hook is called

WC_REST_Tax_Classes_V1_Controller::prepare_item_for_response()
woocommerce_rest_prepare_tax
WC_REST_Taxes_V1_Controller::prepare_item_for_response()
woocommerce_rest_prepare_tax
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-tax-classes-v1-controller.php 267
return apply_filters( 'woocommerce_rest_prepare_tax', $response, (object) $tax_class, $request );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php 568
return apply_filters( 'woocommerce_rest_prepare_tax', $response, $tax, $request );

Where the hook is used in WooCommerce

Usage not found.