Skip to content

Instantly share code, notes, and snippets.

@ucheng
Last active April 24, 2017 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucheng/8d34a4f0468fe4b70e1cb3a6da85898c to your computer and use it in GitHub Desktop.
Save ucheng/8d34a4f0468fe4b70e1cb3a6da85898c to your computer and use it in GitHub Desktop.
change the default user role for woocommerce register user
<?php
add_filter( 'woocommerce_new_customer_data', 'my_new_customer_data');
function my_new_customer_data($new_customer_data){
$new_customer_data['role'] = get_option( 'default_role' );
//$new_customer_data['role'] = 'vip';
return $new_customer_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment