Opened 7 years ago
Closed 7 years ago
#40162 closed enhancement (fixed)
Don't alter the order of roles in the Role dropdown when editing a user
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-screenshots has-patch commit |
Focuses: | administration | Cc: |
Description
When editing a user, the user's current role gets moved to the top of the list of roles shown in the Role
dropdown. Reordering items in a list can be confusing, and although the roles in WordPress aren't strictly hierarchical there is an implied hierarchy that should be maintained in this list.
Attachments (5)
Change History (16)
#5
@
7 years ago
Seems like that is defined here.
https://github.com/WordPress/WordPress/blob/master/wp-admin/user-edit.php#L363
Using this function.
https://developer.wordpress.org/reference/functions/wp_dropdown_roles/
So default user roles in core hierarchy would be the following then?
https://codex.wordpress.org/Roles_and_Capabilities#Summary_of_Roles
Super Admin
Administrator
Editor
Author
Contributor
Subscriber
How would additional user roles either custom added or by a plugin relate to the hierarchy of the user roles in core, would those be based on user capabilities, for example WooCommerce adds in two new user roles, Customer and Shop Manager.
https://codex.wordpress.org/Roles_and_Capabilities#Capabilities
#6
@
7 years ago
- Keywords has-patch added; needs-patch removed
How would additional user roles either custom added or by a plugin relate to the hierarchy of the user roles in core, would those be based on user capabilities, for example WooCommerce adds in two new user roles, Customer and Shop Manager.
While related, I think this is out of scope for this ticket as this is only about not resetting the index of the currently selected role.
After proposed patch (40162.diff) here's how it appears like:
Hi @johnbillion
So, you mean we need to display the all the roles list default way, not the user's current role gets moved to the top of the list?
If I understand properly then please let me know so I can add my patch here.