[wp-trac] [WordPress Trac] #34996: Ordering taxonomies by term meta
WordPress Trac
noreply at wordpress.org
Fri Dec 11 02:16:25 UTC 2015
#34996: Ordering taxonomies by term meta
-------------------------+-----------------------------
Reporter: eherman24 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-------------------------+-----------------------------
Changes (by boonebgorges):
* keywords: 2nd-opinion dev-feedback => needs-patch
* milestone: Awaiting Review => Future Release
Comment:
I am not a big fan of the 'meta_key' parameter in our other query methods;
I think it's a legacy param from before we had `meta_query`, etc. I agree
that it would be nice to add the ability to sort by the results of a meta
query, but I wonder if we could get away with only adding named-key
support, as introduced in WP 4.2 or 4.3 (I forget which):
{{{
$terms = get_terms( 'my_tax', array(
'meta_query' => array(
'mq_clause_1' => array( ... ),
'mq_clause_2' => array( ... ),
'relation' => 'OR',
),
'orderby' => 'mq_clause_1',
) );
}}}
'meta_key' ends up getting translated to this anyway. Is this too opaque a
syntax?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34996#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list