[wp-trac] [WordPress Trac] #44505: term_order is an invalid orderby parameter in WP_Term_Query::get_terms()

WordPress Trac noreply at wordpress.org
Wed Aug 8 19:29:46 UTC 2018


#44505: term_order is an invalid orderby parameter in WP_Term_Query::get_terms()
---------------------------+------------------------
 Reporter:  swinggraphics  |       Owner:  (none)
     Type:  enhancement    |      Status:  closed
 Priority:  normal         |   Milestone:
Component:  Taxonomy       |     Version:
 Severity:  minor          |  Resolution:  duplicate
 Keywords:                 |     Focuses:
---------------------------+------------------------
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => duplicate
 * milestone:  Awaiting Review =>


Comment:

 Hi @swinggraphics - Thanks for your ticket, and welcome to WordPress Trac!

 The `term_order` column is in the `wp_term_relationships` table. As such,
 it's only possible to use that column for ordering when joining against
 the `relationships` table, and `WP_Term_Query` only does this when
 `object_ids` are passed to the query. So the limitation you've cited in
 `WP_Term_Query` is technical - it's not possible to remove it.

 The ability to specify term order would be an interesting feature, and has
 been proposed in a number of places. See #30244, #9547. These solutions
 would have to use something other than the `term_order` column in
 `wp_term_relationships`, for backward compatibility and other reasons, but
 those tickets have some good discussion about what such a feature might
 look like.

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


More information about the wp-trac mailing list