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

Filter allowed query vars for the REST API.

This filter allows you to add or remove query vars from the final allowed list for all requests, including unauthenticated ones. To alter the vars for editors only.


add_filter( 'woocommerce_rest_query_vars', 'wp_kama_woocommerce_rest_query_vars_filter' );
function wp_kama_woocommerce_rest_query_vars_filter( $valid_vars ){
	// filter...

	return $valid_vars;
{ Array of allowed WP_Query query vars.
@param string $allowed_query_var The query var to allow.


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

woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-posts-controller.php 608
$valid_vars = apply_filters( 'woocommerce_rest_query_vars', $valid_vars );

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

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