woocommerce_rest_customer_allowed_roles

FILTER woocommerce\includes\rest-api\Controllers\Version1\class-wc-rest-customers-v1-controller.php (ligne 158) github
Filter the allowed roles for the REST API. Danger: Make sure that the roles listed here cannot manage the shop.

Paramètres

Entrée :
array( 'customer', 'subscriber'
Sortie :
@param array $roles Array of allowed roles.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_rest_customer_allowed_roles'
add_filter('woocommerce_rest_customer_allowed_roles', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(array( 'customer') {
    // Modifier la valeur
    return array( 'customer';
}

Actualités

Chargement des actualités...