Assign Multiple User Roles

By: Michael Clark | Asked: 04/19/2024
ForumsCategory: Code HelpAssign Multiple User Roles
Michael ClarkMichael Clark asked 4 weeks ago
I'd like to be able to use the User Registration feature and assign users to multiple roles via checkbox. I need a code snippet for that. I'm about to see if I can use conditional actions, but it doesn't look likely (or seem practical). Anyone have code they'd like to share? Much appreciated!
1 Answers
Victor Font answered 4 weeks ago
I do this on the Formidable Masterminds site. I’ll give you the code when I’m on my laptop later today. 
Victor Font replied 4 weeks ago

Michael, this is the code I use for the developers directory. It should help you get started.

https://gist.github.com/vfontjr/263cdf33d5ea5a84e0f0601406ff99b9#file-user_role_add-remove-php

Michael ClarkMichael Clark replied 4 weeks ago

It'd be great if the FF folks added the ability to assign multiple roles to users created with their Register User action. Could implement via the ability to add multiple Reg User actions and we could then do conditionals, or better yet, let us use a checkbox field or multi-select field to assign roles.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right