How to assign role to a custom registration form?
One way of doing it is, when you are submitting the registration form, define a value for the ‘role’ and then pass it with wp_insert_user Codex. Like this: $fields_user = get_fields_user(); //get the values from the form and put them in an array. $fields_user[‘role’] = ‘participant’; //define a value for the key ‘role’ $user_id = … Read more