[wp-trac] [WordPress Trac] #34996: Ordering terms by term meta

WordPress Trac noreply at wordpress.org
Sat Feb 6 04:41:28 UTC 2016


#34996: Ordering terms by term meta
-------------------------------------------------+-------------------------
 Reporter:  eherman24                            |       Owner:
     Type:  enhancement                          |  boonebgorges
 Priority:  normal                               |      Status:  closed
Component:  Taxonomy                             |   Milestone:  4.5
 Severity:  normal                               |     Version:  4.4
 Keywords:  has-patch needs-testing has-unit-    |  Resolution:  fixed
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"36485"]:
 {{{
 #!CommitTicketReference repository="" revision="36485"
 Allow `get_terms()` results to ordered by metadata.

 The `$orderby` parameter of `get_terms()` now accepts the following
 values,
 related to term meta:

 * 'meta_value'
 * 'meta_value_num'
 * the value of the `$meta_key` parameter
 * any key from the `$meta_query` array

 This brings order-by-meta support for terms in line with post, comment,
 and
 user queries.

 As a byproduct of these improvements, `$meta_key` and `$meta_value`
 parameters
 have been introduced to `get_terms()`. They interact with `$meta_query` in
 the
 same way as in `WP_Query` and other query classes.

 Props jadpm, eherman24.
 Fixes #34996.
 }}}

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


More information about the wp-trac mailing list