Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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