Skip Navigation

[Gelöst] Auto assign a Role to a user while registering through User Form, based on age.

This support ticket is created vor 3 Jahre, 5 Monate. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Shane vor 3 Jahre, 5 Monate.

Assisted by: Shane.

Author
Artikel
#1825101

I want to auto-assign a Custom Role, based on the user age, when they register to the website through a User Form.

How can I achieve it?

#1825315

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Giulia,

Thank you for getting in touch.

The user role is assigned to the user whenever you are creating the form. In order to achieve your query you will need to make use of custom code to check what is the age value the user added to the form and set their user role based on this.

Unfortunately the custom code required to do this is out of the scope of our support forum, however I can point you to the hook that you will need to use to hook into the form when its submitted.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Please let me know if this helps.
Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.