API / Minn\Runtime / TermOrder

TermOrder final class

Minn\Runtime\TermOrder · public/minn/src/Minn/Runtime/TermOrder.php · 61 lines

A term query's ORDER BY as the reference writes it (probe wp-term-query-sql): term and taxonomy columns, the relationship's order, the order include or slug lists give, none, or the name; then get_terms_orderby, and after it a meta key or meta_value[_num] when the query has meta clauses.

Constants and properties

privateTERM_COLUMNS = array ( 0 => 'term_id', 1 => 'name', 2 => 'slug', 3 => 'term_group', )
privateTAXONOMY_COLUMNS = array ( 0 => 'count', 1 => 'parent', 2 => 'taxonomy', 3 => 'term_taxonomy_id', 4 => 'description', )

Public

staticdirection(mixed $order): string#

ASC when asked for, DESC for anything else.

staticclause(WP_Term_Query $query, string $raw): string#

The ORDER BY body for an orderby value, filtered as the reference filters it.

staticmeta(WP_Term_Query $query, string $orderby): string#

A meta key, meta_value[_num] or a named meta clause as SQL (parse_orderby_meta), or '' when the query has no such clause.