Support » Plugin: Role Includer » Compatibility with Advanced Custom Fields when Editing User

  • Tessa


    Hi again! So this is related to my feature request for adding the checkboxes to the Edit User screen (see this topic), but is actually kind of a bug.

    Here is my current step-by-step issue:

    1. I am using Advanced Custom Fields (ACF) where I have a field group with “Location” rules as follows: User Role is equal to <custom role A>
    2. I have an existing user where their WordPress/primary Role is set to <custom Role B> and the ACF group doesn’t appear as expected.
    3. Using your plugin, I assigned <custom Role A> to the user, so now they have multiple roles, A and B. Yes!
    4. I go back to edit the user and the ACF group now appears as expected
    5. I make my changes to the user, click “Update User”, but when the page refreshes, the ACF group disappears. I check their assigned roles using your plugin, and it’s back to just <custom Role B> being checked and they no longer have their second role assigned.

    This makes sense for why the ACF group disappeared since the location rule no longer matched, but as you can see, updating the user from the /wp-admin/user-edit.php?user_id=1 screen essentially reverted them back to their single, primary WordPress role. I think this is related to my feature request from earlier because I think if you add your checkboxes to this page, you could work your plugin magic to ensure the user’s multiple roles are saved when the user is updated from this screen.

    My current workaround is to just re-assign the role back to the user after making my changes with the ACF group, because the ACF data does get saved for that user, it just no longer appears because the “location” rule no longer matches when the role is unset/reverted. It’s annoying because I will be editing users a lot, and will be training other non-developers on editing users, but I can manage with this workaround for now.


Viewing 1 replies (of 1 total)
  • Plugin Author Justin Fletcher


    Thanks for the feedback on this I’ll put it on the list for further work.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.