Problem:
How to allow users to choose their role in a user registration form?
Solution:
There is no option to include a role selector in such a form, but you can add a generic select field to the form where the role option is chosen, and then use the cred_save_data hook to run some code that updates the role after the form has been submitted and the user created.
An example is given in this linked thread: https://toolset.com/forums/topic/radio-buttons-selection-triggers-assigning-to-one-of-2-user-roles/
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 4 replies, has 2 voices.
Last updated by 6 years, 2 months ago.
Assisted by: Nigel.