QueryFlags final readonly class
Minn\Runtime\QueryFlags · public/minn/src/Minn/Runtime/QueryFlags.php · 197 lines
The conditional flags a set of query variables implies (is_single, is_archive, is_home, ...), derived the way the reference's parse step derives them, plus the variables after the integer casts that step applies.
Constants and properties
| private | INTEGER_VARS = array ( 0 => 'p', 1 => 'page_id', 2 => 'attachment_id', 3 => 'year', 4 => 'monthnum', 5 => 'day', 6 => 'w', 7 => 'paged', ) | |
| prop | readonly array $vars | Promoted from the constructor. |
| prop | readonly array $flags | Promoted from the constructor. |
Public
| new | __construct(array $vars, array $flags)# |
| |||||||||
| static | fill(array $vars, Minn\Runtime\Registry $registry): array# | The variables with every one the reference fills given its empty value: the template's keys up to search_columns (the ones after it are get_posts' own, settled when the query runs).
@return array<string, mixed> | |||||||||
| static | derive(array $vars, Minn\Runtime\Registry $registry, callable $option, array $asked): self# | The is_* flags the query vars amount to.
| |||||||||
| static | customTaxonomyVar(array $vars, Minn\Runtime\Registry $registry): ?array# | The first registered taxonomy (other than the two built-in ones) whose query variable carries a value, as [taxonomy name, query var]. @return array{0: string, 1: string}|null |
Internals 2
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | sanitize(array $vars): array# | The reference's clean-up of the free-form variables: m and the time parts to digits, cat and author to id lists, names trimmed, an over-long or non-scalar search dropped.
@return array<string, mixed> | |||
| private | archiveFlags(array $vars, Minn\Runtime\Registry $registry): array# | @return array<string, bool> |
Nothing matches.