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

Filter the allowed 'private' query vars for authorized users.

If the user has the edit_posts capability, we also allow use of private query parameters, which are only undesirable on the frontend, but are safe for use in query strings.

To disable anyway, use add_filter( [woocommerce_rest_private_query_vars](/plugin/woocommerce/hook/woocommerce_rest_private_query_vars),'__return_empty_array');

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

add_filter( 'woocommerce_rest_private_query_vars', 'wp_kama_woocommerce_rest_private_query_vars_filter' );

/**
 * Function for `woocommerce_rest_private_query_vars` filter-hook.
 * 
 * @param array $private_query_vars Array of allowed query vars for authorized users. }
 *
 * @return array
 */
function wp_kama_woocommerce_rest_private_query_vars_filter( $private_query_vars ){

	// filter...
	return $private_query_vars;
}
$private_query_vars(массив)
Array of allowed query vars for authorized users. }

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

WC_REST_Posts_Controller::get_allowed_query_vars()
woocommerce_rest_private_query_vars
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-posts-controller.php 572
$private = apply_filters( 'woocommerce_rest_private_query_vars', $wp->private_query_vars );

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

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