Hello and thank you for your answer !
I also thought it could have been that but it doesn't work on my end.
It systematically puts the same role "subscriber".
Registration takes place on this page : https://lagora33.com/jentre-dans-lagora-33/
It's ok it works. Thanks a lot !
Hello and thank you for your answer.
Unfortunately this solution only works if the person submits an answer when he is already connected. This is a form submission without an account.
That's not true. People do not have to be logged in for you to create roles for their accounts when using the user registration add-on.
I assign multiple roles to developers depending on the choices they make in the registration form when they join the Formidable Masterminds Developers Directory. This is during the account creation process before they are logged in. The code I shared with you can be adopted to suit your need.
You have to use the frm_after_create_entry and frm_after_update_entry hooks. The code in the article should be enough to get you started if you're a WordPress/PHP developer because you have to use the WordPress user_meta functions to add, update, get, or delete roles on demand.
You should also know that if you use the email verification process in the registration add-on, there's a bug in the add-on that deletes all user roles when it changes "pending" to "subscriber". The bug was reported to Strategy 11. I don't know if it's been fixed yet. If the bug hasn't been fixed, it's necessary to create a work around that resets the roles in the frmreg_after_create_user action.
If you're not comfortable developing and testing this much code, I suggest you consider hiring someone to help if you don't find the starter code helpful. This is a good starting point:
https://formidable-masterminds.com/developers-directory/. Plan for 8hrs of developer time as your budget.
Please login or Register to submit your answer