Opened 9 years ago
Closed 9 years ago
#32735 closed defect (bug) (fixed)
Correctly sort translated plugin names in plugin list table
Reported by: | swissspidy | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Plugins | Keywords: | has-patch needs-testing |
Focuses: | ui, administration | Cc: |
Description
Pretty all list tables in WordPress have some sortable columns, except for the plugins screen.
This is pretty annoying when you have lots of plugins, as there is no clear order. It gets worse when plugins localized names. Example:
Here, the User Switching plugin should clearly not be at the end.
Funnily, the plugin list table already supports the orderby
and order
parameters, just the UI is missing.
Attachments (4)
Change History (22)
#1
@
9 years ago
Removed in [17338], see #16322 (comment by @nacin).
#2
@
9 years ago
Thanks for the hint. Per nacin's 4-year old comment:
Per discussion with PeteMall and Jane in IRC, since sorting and pagination on the plugins screen is stateless, we should remove sorting on the plugin name column. Sorting, then making any action, will cause you to lose the action, which is lame.
Maybe it's time to make it not stateless anymore and save it as a user setting? Or at least make the sortable columns filterable (empty by default?) so a plugin can implement sorting. For example, a plugin could allow sorting plugins by their activation date.
Also lame, is that unlike on other screens that might be sorted by something else by default, the screen is already sorted by name. So the most this can do anyway is sort by name descending. Or as I like to call it, scroll to the bottom and use your imagination.
The sorting is still not correct when you have translated plugin names. However, this can be solved by having sortable columns and a default order of ?orderby=name&order=asc
. It's very annoying when you have lots of plugins and you need to find plugins somewhere on the page. And no, Cmd+F is not a solution.
#3
@
9 years ago
Maybe not sortable but they should definitely be ordered by their translated name and here @swissspidy makes a very good point :)
#4
@
9 years ago
It should be very easy to sort these by translated name. I don't see how adding sortable columns helps that otherwise.
#5
@
9 years ago
This second patch defaults to order by name, which fixes the behavior for translated plugin names. If we only implement this, I can live with it. Although sorting by description would be nice too (like with taxonomies)…
Totally forgot that I can use the "manage_{$this->screen->id}_sortable_columns"
filter if I want to add an additional sortable column (e.g. activation date).
#6
@
9 years ago
- Keywords has-patch added
- Summary changed from Make plugin list table sortable to Correctly sort translated plugin names in plugin list table
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
9 years ago
#9
@
9 years ago
- Owner set to ocean90
- Resolution set to fixed
- Status changed from new to closed
In 33010:
This ticket was mentioned in Slack in #core by dd32. View the logs.
9 years ago
#12
@
9 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
#14
@
9 years ago
- Keywords has-patch needs-testing added; needs-patch removed
The _order_callback()
function didn't seem to be being used elsewhere. I'm not sure if sortable plugin data could include non-string data (at least data that won't sort with strcasecmp()
- if so, then the patch won't work.
#16
@
9 years ago
Sortable plugin data should only include strings, and 32375.diff looks good.
Should we do the same in WP_Plugin_Install_List_Table::order_callback()
and WP_MS_Themes_List_Table::_order_callback()
, for consistency?
Make plugin list table sortable