[wp-trac] [WordPress Trac] #23421: Add sortable to taxonomy column

WordPress Trac noreply at wordpress.org
Fri Feb 28 20:59:46 UTC 2020


#23421: Add sortable to taxonomy column
------------------------------------------------+--------------------------
 Reporter:  tifosi                              |       Owner:  swissspidy
     Type:  enhancement                         |      Status:  assigned
 Priority:  normal                              |   Milestone:  Future
                                                |  Release
Component:  Taxonomy                            |     Version:
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch dev-feedback 2nd-opinion  |     Focuses:
------------------------------------------------+--------------------------
Changes (by cr0ybot):

 * keywords:  has-patch => has-patch dev-feedback 2nd-opinion


Comment:

 I took a crack at this in 23421.2.diff—it's a more complicated feature
 than it seems on the face of it. Most notably, ordering by a taxonomy
 column, where multiple terms may be present on a single post, actually
 means ordering by the plain-text list of terms concatenated. So any posts
 with just "Term A" applied will be grouped, and then a post with "Term A,
 Term B" will come after.

 After all this effort, I wonder if orderby on a taxonomy column even makes
 sense. It seems as though a more generic taxonomy filter (as suggested by
 @tifosi as a show_admin_filter option) would provide more predictable or
 expected results.

 I used most of what @jtsternberg had, though I moved most of the
 functionality into the WP_Posts_List_Table since that seemed to be the
 precedence set by the code for `show_admin_column`. I also added the
 setting to the `WP_Taxonomy` class, and the `posts_clauses` filter is
 applied in `admin-filters.php`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/23421#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list