Assign Role During Signup


My WordPress website has a few custom wordpress roles in addition to the standard Editor, Subscriber, etc. I have custom roles as “Basketball Player”, “Soccer Player”, for example.

1) I would like to be able to add a dropdown to the signup form so the person can select their role. I know how to add a custom field to the signup form – I just don’t know how to programmatically assign a user to a role.

update_user_meta looks promising but I am not sure..