Opened 8 years ago
Closed 8 years ago
#40168 closed defect (bug) (wontfix)
User roles should be populated in Alphabetical order
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.1 |
Component: | Users | Keywords: | has-patch has-screenshots |
Focuses: | administration | Cc: |
Description
User role dropdown in user Add and Edit screens should be populated in alphabetical order by default.
Attachments (3)
Change History (11)
#3
@
8 years ago
- Keywords reporter-feedback has-screenshots added
Just tried your patch but still it shows "Subscriber" on top of the list while it should come at the bottom of the list. Screenshot added.
#5
@
8 years ago
https://core.trac.wordpress.org/ticket/40162 will take care of the issue that's putting the currently selected role on top.
#7
@
8 years ago
- Keywords dev-feedback added
I'm not sure I agree with alphabetizing the roles in the dropdown. There is an implied hierarchy by the default roles in WordPress. Currently, all dropdowns order roles by least to most capabilities.
#40162 is a bug in that it gives priority to the role of the user being edited, but I think alphabetizing would lose that ordering, which is actually really consistent across all pages right now.
That being said, the patch fixes properly alphabetizes the list for me. I believe that it will only accurately alphabetize the list in English though. The translate_user_role()
call in the foreach
loop could potentially cause the list to be improperly ordered if the user's language is other than English because translation happens after your sort.
Marking this dev-feedback
for another opinion.
#8
@
8 years ago
- Keywords dev-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
- Version changed from 4.7.3 to 2.1
I also don't think the list of roles should be displayed alphabetically. Plugins can control the way in which roles are displayed via various means, such as the wp_user_roles
option, the $wp_roles->roles
property, and the editable_roles
filter.
Thanks for the suggestion, @subrataemfluence.
Related: #40162