woocommerce_rest_private_query_vars

FILTER woocommerce\includes\rest-api\Controllers\Version3\class-wc-rest-posts-controller.php (ligne 572) github
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. }

Paramètres

Entrée :
$wp->private_query_vars
Sortie :
@param array $private_query_vars Array of allowed query vars for authorized users.

Utilisation

// 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;
}

Actualités

Chargement des actualités...