add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { $new_customer_data['role'] = get_option( 'default_role' ); return $new_customer_data; }
Set user role to WordPress default role during WooCommerce checkout
This post brought to you by RocketGeek, ButlerBlog, and the following: