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' );` @param array $private_query_vars Array of allowed query vars for authorized users. }
$wp->private_query_vars
Sortie :
@param array $private_query_vars Array of allowed query vars for authorized users.
// Modifier la valeur avec le filtre 'woocommerce_rest_private_query_vars'
add_filter('woocommerce_rest_private_query_vars', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($wp->private_query_vars) {
// Modifier la valeur
return $wp->private_query_vars;
}
Chargement des actualités...