TermQueryRunner final class
Minn\Runtime\TermQueryRunner · public/minn/src/Minn/Runtime/TermQueryRunner.php · 255 lines
WP_Term_Query::get_terms as the reference runs it (probe wp-term-query-sql): the variables parsed and handed to pre_get_terms, get_terms_args, the WHERE pieces (taxonomies, inclusions, exclusions with excluded trees and childless terms through list_terms_exclusions, names, slugs, term taxonomy ids, likes, objects, parent, counts, search, meta), the order through get_terms_orderby, the fields through get_terms_fields, all of it through terms_clauses, terms_pre_query, and the results shaped by TermQueryTree (children, padded counts, the empty hidden, the page).
Constants and properties
| private | WP_Term_Query $query | |
| private | object $wpdb | |
| private | array $where |
Public
| method | run(WP_Term_Query $query, object $wpdb): mixed# | Runs a term query object's variables: its terms in the shape the fields ask for, a count, or what a plugin answered first.
|
Internals 12
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | lists(array $args): array# | Names, slugs, term taxonomy ids and object ids as lists, as the reference holds them once plugins have had the arguments.
@return array<string, mixed> | ||||||
| private | hierarchical(array $args): bool# | Whether the results have a tree to walk (a count never does). @param array<string, mixed> $args
| ||||||
| private | settle(array $args, array $taxonomies): array# | The variables pre_get_terms left, settled: a flat taxonomy needs no tree, a parent overrides child_of, `get=all` asks for every term; then get_terms_args.
@return array<string, mixed> | ||||||
| private | inHierarchy(int $parent, array $taxonomies): bool# | Whether a parent or child_of term has children in any of the taxonomies (when none, the query is not run). @param list<string> $taxonomies
| ||||||
| private | order(array $args): array# | The ORDER BY clause and direction, term_order needing the relationships. @param array<string, mixed> $args @return array{0: string, 1: string}
| ||||||
| private | clauses(array $args, array $taxonomies): void# | The WHERE pieces, by name, in the reference's order. @param array<string, mixed> $args @param list<string> $taxonomies
| ||||||
| private | exclusions(array $args, array $taxonomies): string# | The excluded ids (an excluded term's whole tree, childless terms' parents), unless ids are included. @param array<string, mixed> $args @param list<string> $taxonomies
| ||||||
| private | names(array $args, array $taxonomies): void# | Names (as saving stores them), slugs and term taxonomy ids. @param array<string, mixed> $args @param list<string> $taxonomies
| ||||||
| private | likes(array $args): void# |
| ||||||
| private | select(array $args, array $taxonomies, string $orderby, string $order): void# | The rest of the WHERE (counts, search, meta), the fields, the joins, terms_clauses, and the request written from what it returned.
| ||||||
| private | limits(array $args): string# | A LIMIT only when no tree has to be walked first (the tree's page is cut afterwards). @param array<string, mixed> $args
| ||||||
| private | meta(): array# | The meta query's join and WHERE piece, read again in case pre_get_terms changed its variables. @return array{0: string, 1: string} @return array{0: string, 1: string} |
Nothing matches.