#43705 closed defect (bug) (duplicate)
Respect custom taxonomy term order on admin edit page when show_ui and sort are both true
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 5.1 |
| Component: | Taxonomy | Keywords: | |
| Focuses: | Cc: |
Description
This is identical to the report in #40436, but that has been awaiting review for 12 months and might have fallen under the radar due to being set to version 4.7. The issue is still present in 4.9.5. The order of terms is not respected on e.g. the admin post list. It displays alphabetically even when sort is set to true in register_taxonomy (in addition to show_ui set to true to make it show on the post list).
The order is not respected because the call to wp_get_object_terms via column_default in WP_Posts_List_Table does not supply an $args array telling it how to sort. WordPress should probably supply this array with the order_by key set if the taxonomy's sort attribute is true.
Change History (4)
Note: See
TracTickets for help on using
tickets.
It should be added that using the
get_the_termsfilter inget_the_termsinwp-includes/category-template.phpdoes not allow this behaviour to be added via a plugin (without completely requerying the terms), because the filter does not supply theterm_ordercolumn from theterm_relationshipsdatabase table.