[wp-trac] [WordPress Trac] #44505: term_order is an invalid orderby parameter in WP_Term_Query::get_terms()
WordPress Trac
noreply at wordpress.org
Tue Jul 3 19:48:25 UTC 2018
#44505: term_order is an invalid orderby parameter in WP_Term_Query::get_terms()
---------------------------+-----------------------------
Reporter: swinggraphics | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: minor | Keywords:
Focuses: |
---------------------------+-----------------------------
This is a follow-up to #35381.
I'm wondering why `term_order` is not allowed as the `orderby` parameter
in `WP_Term_Query::get_terms()` for functions like `get_terms()`. It is
specifically invalidated on line 388. Granted, term_order isn't used for
much in core right now, but the column is there, and one generally expects
any column heading to be a valid orderby parameter. The workaround is to
create custom meta for the terms and add a `meta_query`. There are
examples on StackExchange/Overflow of people looking for a remedy. In
fact, there is an example of this on trac ticket:34996, where the example
used for justifying the addition of meta_query only exists because
term_order is a rejected orderby.
I'm marking this as an "enhancement" because the code does what is
intended, but unless one delves into the source code, it ''feels'' like a
bug.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44505>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list