role select and Role column, so core’s own checks on user-new.php and user-edit.php keep working.bbp_get_dynamic_roles(). The select uses bbPress’s field name bbp-forums-role, so bbPress’s own handlers save it on edit, add-existing, invitation and signup. This plugin only handles clearing it, because bbPress ignores an empty value.customer and shop_manager, limited to roles registered on the site. Saved by this plugin.WP_User::set_role() removes every role a user holds. keep_bucket_roles() hooks set_user_role and, whenever a site role is set, adds back the forum and shop roles from $old_roles. This covers the Edit User screen, the bulk Change role action and code such as wp_update_user(). Bucket saves that run later (bbPress at profile_update 10, this plugin at 20) still apply the user’s new choice.
profile_update 20.user_register.signup_user_meta stores the role, and wpmu_activate_user 20 applies it on the signup’s add_to_blog site.invite_user stores the role in user meta lh_multiple_roles_pending_shop_role_{blog_id}, and added_existing_user applies it, or reads the posted value when no confirmation is needed.Editing needs promote_user on the target user, and never applies to the editor’s own account. A shop role is offered only when the current user holds every capability in it. A user’s current forum or shop role that the editor could not grant is shown disabled and is left unchanged on save.
user-edit.php, user-new.php, users.php), editable_roles drops forum and shop roles from the site Role select and from core’s validation of it.get_role_list drops them from the Role column.BBP_Users_Admin::secondary_role_display, bbp_add_user_form_role_field) and column (user_role_column, user_role_row) are removed on admin_init 100. bbPress’s bulk forum-role dropdown and row actions are kept.lh_multiple_roles_return_forum_role_slugslh_multiple_roles_return_shop_role_slugslh_multiple_roles_return_assignable_shop_roleslh_multiple_roles_init_plugin