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