TermQueryTree final class
Minn\Runtime\TermQueryTree · public/minn/src/Minn/Runtime/TermQueryTree.php · 146 lines
What a term query does with its rows, as the reference does it (probe wp-term-query-sql): each row a term through get_term (with the object id a relationship query carries); only child_of's descendants; counts padded with the children's posts; an empty term kept only while one of its children has posts (the rest dropped where they stood, keys and all); a tree's page cut once the tree is walked; then the shape the fields ask for.
Constants and properties
| private | readonly array $taxonomies | Promoted from the constructor. |
Public
| new | __construct(array $taxonomies)# |
| ||||||
| static | populate(array $rows): array# | The terms the rows name, keyed as the rows were.
@return array<array-key, \WP_Term> | ||||||
| method | settle(array $terms, array $args): array# | The terms after the tree has had its say: descendants only, padded counts, empty branches dropped, the page cut.
@return array<array-key, \WP_Term> | ||||||
| static | pad(array $terms, string $taxonomy): void# | Each term's count raised to the published posts in it or under it, as _pad_term_counts does for a hierarchical taxonomy.
| ||||||
| static | format(array $terms, string $fields): array# | The terms in the shape the fields ask for.
@return array<array-key, mixed> |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | hasPosts(WP_Term $term): bool# | Whether a term, or one of its children, has posts. |
Nothing matches.