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

WordPress Trac noreply at wordpress.org
Fri Jan 29 12:56:59 UTC 2016


#34996: Ordering taxonomies by term meta
------------------------------------------------------+------------------
 Reporter:  eherman24                                 |       Owner:
     Type:  enhancement                               |      Status:  new
 Priority:  normal                                    |   Milestone:  4.5
Component:  Taxonomy                                  |     Version:  4.4
 Severity:  normal                                    |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-tests  |     Focuses:
------------------------------------------------------+------------------

Comment (by jadpm):

 I am attaching a refreshed patch which follows the structure used in
 `WP_Query` and provides:
 * support for `'orderby' => 'meta_value'` which will sort by the first
 `meta_query` clause fields.
 * support for `'orderby' => 'meta_value_num'` which will sort by the first
 `meta_query` clase field as a numeric value.
 * support for `'orderby' => 'meta_value'` combined with `meta_key` which
 will sort by the referenced field key, no matter wthether there is a
 `meta_query` entry for it or not, or even when there are no `meta_query`
 clauses at all.
 * support for `'orderby' => 'meta_value_num'` combined with `meta_key`
 which will sort by the referenced field key as a numeric, no matter
 wthether there is a `meta_query` entry for it or not, or even when there
 are no `meta_query` clauses at all.
 * support for 'orderby' => 'clause_key' which will sort by the referenced
 `meta_query` clause, if any, checking that passing a non-existing clause
 key will produce the default sorting.

 It also provides unit tests to cover all those cases.

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


More information about the wp-trac mailing list