Skip Navigation

[Resolved] Assign secondary role to a Pending approval user via CRED

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.

This topic contains 2 replies, has 2 voices.

Last updated by himanshuS 1 month, 3 weeks ago.

Assigned support staff: Jamal.

Author
Posts
#2122709

I have professionals and experts on the platform.

Anyone can join as a professional but people have to apply to become an expert. I manually approve the expert application and I receive these applications via a CRED form that creates a 'pending approval' user.

However, it turns out these users can request to reset the password and login into the system as pending-approval users. This is not ideal as I want them to have a good experience and my site is not set up to support access for pending approval users.

Instead, I want to programmatically give them access to a 'professional' user when the pending approval user is created.

I saw this note but it requires generic fields - https://toolset.com/forums/topic/allow-users-to-add-a-second-custom-role-to-their-own-account/

As the pending user is already created via expert application CRED form, I was wondering if I can use a CRED hook to add the 'professional' secondary role to the user on registration itself. Is the doable?

#2123235

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

Indeed, it is doable. Check an example on this similar thread https://toolset.com/forums/topic/adding-a-secondary-role-to-a-wordpress-user/#post-607852

#2124323

My issue is resolved now. Thank you!