PostQueryStatus final class
Minn\Runtime\PostQueryStatus · public/minn/src/Minn/Runtime/PostQueryStatus.php · 165 lines
WP_Query's post type and status clause as the reference writes it (probe wp-query-sql). Statuses asked for by name: the type clause, then the statuses (any, less those excluded from search; private kept apart when the query asks for readable posts; the user's own when they may not read or edit others'; an attachment's parent's status for a taxonomy archive). None asked for, on a listing: each queried type, sorted, with its public statuses, the admin list's protected ones in the admin, and private ones the signed-in user may read. A single post: the type clause alone.
Constants and properties
| private | readonly WP_Query $query | Promoted from the constructor. |
| private | readonly Minn\Runtime\PostQueryParts $parts | Promoted from the constructor. |
Public
| new | __construct(WP_Query $query, Minn\Runtime\PostQueryParts $parts)# | ||||
| method | settleType(): void# | Settles the post type the caps come from: a list of several types has none (its caps are named for multiple_post_type), any other names one. | |||
| method | append(array $q): void# | Appends the type and status clause. @param array<string, mixed> $q
|
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | typeWhere(): array# | The type clause, and whether there are no searchable types to give statuses to. @return array{0: string, 1: bool} @return array{0: string, 1: bool} |
| private | cap(string $which): string# | The cap a type's object names, or the one its name makes. |
| private | named(mixed $asked, mixed $perm): void# | Statuses asked for by name (or `any`), under the query's perm. |
| private | listing(): void# | A listing with no statuses asked for: each type with the statuses its reader may see. |
| private | privateStatuses(string $type): string# | The private statuses a signed-in user sees in a type: all of them with the cap to read them, their own otherwise. |
Nothing matches.