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','__return_empty_array');
Использование
add_filter( 'woocommerce_rest_private_query_vars', 'filter_function_name_7045' ); function filter_function_name_7045( $private_query_vars ){ // filter... return $private_query_vars; }
- $private_query_vars(массив)
- Array of allowed query vars for authorized users. }
Где вызывается хук
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 );