Can Pro Forms change a user role?

I’ve seen this asked a few times, but in search this forum and the Facebook group, I’ve yet to find an answer. I posted to the Facebook group but nothing there either. So I’m not sure if it is even possible, but I hope it is.

Here’s what I’m trying to do. I have a client with a small business who wants to manage users on their website. I’ve used ACF to create some custom fields for the users (company name, and a drop-down for a customer attribute specific to their business). Editing each user in the standard WordPress admin is a bit of a mess as there’s so many other fields that are not relevant.

I want to use BricksForge Pro Forms to build a custom user management process. I’d have a restricted access page listing all users with a role of subscriber, contributor or author. The admin or editor would click on a specific user to access a page to edit that user. This page would use Pro Forms to edit first/last name, email address, the ACF custom fields.

I also want to allow admins/editors to re-assign the user to a different role as needed. Ideally, I’d have a list of radio buttons for each role, with the user’s current role selected. The admin/editor could then select a different user role and submit the change. This is where I’m stuck. First, is this even possible? If so, how can I create the query to pull back the list of available user roles and show the currently assigned role for the selected user?

thanks!

2 Likes

Hey :slight_smile: You cannot change user roles out of the box. You need to use the “Custom” action and write php code to handle this.

I’m no expert in the field, but it’s something that I want to be able to achieve too. So I’ve been researching it for a few months, reading and watching videos. Some of the best are by Paul Charlton (WPTuts) and David Denedo (Daveden).

I can’t find the exact tutorials that I was thinking of right now. But check out their YouTube channels and websites. Or try the 2 videos below.

Paul Charlton (WPTuts)
https://www.youtube.com/@WPTuts
https://youtu.be/o3RBGLhTVxY

David Denedo (Daveden)
https://www.youtube.com/@daveden2
https://youtu.be/9mP20t3SqOg

(first post, so I’m not sure how those links will render)