I ended up just adding a second hook to remove_user_role using the same function
add_action( 'remove_user_role', 'update_user_department', 10, 1 );
Related Posts:
- Grouping users under parent user
- \WP_User Object | What’s the Difference Between {caps} and {allcaps}?
- Are User Levels Still Currently Used?
- Updating wp_user_level on user update
- Can I Create a Second Admin Level User Role?
- Assigning multiple or additional capabilities to specific users or how to create additional roles like bbpress roles?
- how do I add role and capability after I create a new user
- Update user role for expired membership
- How to Moderate Edits to User Profiles?
- In admin manage users page, how can I stop users with certain privileges from editing users with other privileges?
- Creating Custom user type just like custom post
- Editor can create any new user except administrator
- Find out if logged in user is not subscriber
- get_user_meta() doesn’t include user email?
- User-edit role setting distinct from wp_capabilities? [closed]
- Check if user is admin by user ID
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to display custom user meta from registration in backend?
- Allowing an email as the username?
- How to update user role without logout
- Do not allow users to create new posts and pages
- How we can get the user id by its display_name
- WP_User_Query with combined meta query – not working?
- LEFT JOIN, INNER OUTER JOIN, LEFT OUTER JOIN is driving me crazy. Please help?
- How to assign an additional/extra/second user-role to multiple users (of a specific user-role)
- How to stop a user from updating the post date
- How to add follow functionality to multi-author wordpress site?
- Search multiple meta keys at once
- WordPress edit_user_profile_update update secondary role
- ACF Upload Image in front-end with custom form
- How to customize wp_signon()
- Is it possible to get a user with just the password field?
- How to get the Role Name of the current user? (WordPress)
- set_role has no effect
- How to add country drop down menu to the user profile?
- Users roles, make a page belonging to multiple users
- Add custom fields to the user profile
- How do I list in the backend all users that were assigned to a custom role?
- stop login if user_status equal zero
- How to add local users to wordpress without email password?
- WP User Query fails when searching meta queries and search columns
- How can i create an array user meta?
- Getting users by specific capability, not role
- Updating user meta
- create shortcode to list users with specific meta key value
- Error: How to allow the “contributor” to upload media in wordpress
- Remove Capabilities from WP admin for specific user role
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- User capability for editing their own comments
- get_user_meta an ID for multiple functions
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- Problem with automatic role change through cron job
- Allow Contributors to Upload Files
- Is possible to allow user to login with different role?
- Creating user without username and password
- Is this code true or not
- User description only displayed for logged user
- How do I let contributors edit their posts after being approved once?
- Assign random (and unique) user meta upon registration
- Load user by specific role
- Display the line breaks in user bio without using html
- how to set default update_user_meta values wordpress
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- Get user by meta key – WP multi site
- Cannot Update user meta in custom field
- New User Save Filter
- Get users with different roles and call function on each of them (user_meta)
- Change User Role based on Point System Issue
- How do I modify the user role ‘subscriber’ to allow the user to delete posts
- delete_user_meta from a foreach results page
- Reading additional fields in PMPro
- Can I add a unique code for each user based on the location?
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- Getting user data via ajax
- fine-grained capabilities for user related capabilities
- wp_get_current_user Not working
- Groups roles & capabilities
- Custom User Role: Can Edit Own Page, Cannot Create New
- Get meta key with value for user
- user and usermeta table not found
- Button for users to upgrade their user role + Button to show current user role!
- UserMeta Changes Meta Value for Post ID
- Restrict Access to the User Profile
- Username has been exposed
- Subscriber role – blank page
- How to get only 1 role from user
- User “none” role
- Get author meta of all writers
- i need to let a user to add a role from a frontend form
- Limit user access to installing/configuring a plugin?
- Increase by one the user counter on specific role
- Show only users with the same role in Dashboard user list
- Add custom input field in new user page
- WordPress – Security Question at Login from User’s Meta Data
- Remove My Account Menu items in Woocommerce based on user roles
- WordPress: New user role which is ONLY allowed to manage media