Created
May 5, 2016 01:15
-
-
Save garvs/22c81c02f1cfe68ba8fecf59217ea357 to your computer and use it in GitHub Desktop.
Assign to new WooCommerce registered user another role instead of customer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code snippet is used by post:
https://www.role-editor.com/woocommerce-assign-role-instead-customer/