woocommerce_rest_tax_query filter-hookWC 1.0

Filter arguments, before passing to $wpdb->get_results(), when querying taxes via the REST API.

Usage

add_filter( 'woocommerce_rest_tax_query', 'wp_kama_woocommerce_rest_tax_query_filter', 10, 2 );

/**
 * Function for `woocommerce_rest_tax_query` filter-hook.
 * 
 * @param array           $prepared_args Array of arguments for $wpdb->get_results().
 * @param WP_REST_Request $request       The current request.
 *
 * @return array
 */
function wp_kama_woocommerce_rest_tax_query_filter( $prepared_args, $request ){

	// filter...
	return $prepared_args;
}
$prepared_args(array)
Array of arguments for $wpdb->get_results().
$request(WP_REST_Request)
The current request.

Where the hook is called

Taxes::get_items()
woocommerce_rest_tax_query
WC_REST_Taxes_V1_Controller::get_items()
woocommerce_rest_tax_query
woocommerce/src/Admin/API/Taxes.php 83
$prepared_args = apply_filters( 'woocommerce_rest_tax_query', $prepared_args, $request );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-taxes-v1-controller.php 235
$prepared_args = apply_filters( 'woocommerce_rest_tax_query', $prepared_args, $request );

Where the hook is used in WooCommerce

Usage not found.