Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save garvs/22c81c02f1cfe68ba8fecf59217ea357 to your computer and use it in GitHub Desktop.
Save garvs/22c81c02f1cfe68ba8fecf59217ea357 to your computer and use it in GitHub Desktop.
Assign to new WooCommerce registered user another role instead of customer
/**
* Replace 'customer' role (WooCommerce use by default) with your own one.
**/
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
function wc_assign_custom_role($args) {
$args['role'] = 'subscriber';
return $args;
}
@garvs
Copy link
Author

garvs commented May 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment