API / Minn\Runtime / PostQueryResults

PostQueryResults final class

Minn\Runtime\PostQueryResults · public/minn/src/Minn/Runtime/PostQueryResults.php · 113 lines

What WP_Query does with its posts once it has them, as the reference does it (probe wp-query-sql): a single post whose status is not public is dropped unless the reader may see it (a draft its editor may preview, with the_preview); sticky posts move to the front of the home listing's first page, the ones it did not find fetched by a nested query; the_posts; and the post objects, count and current post set.

Used by 1

Constants and properties

privatereadonly WP_Query $query

Promoted from the constructor.

privatereadonly Minn\Runtime\PostQueryParts $parts

Promoted from the constructor.

Public

new__construct(WP_Query $query, Minn\Runtime\PostQueryParts $parts)#
methodsettle(array $q): void#

Settles the posts a query found: status check, stickies, the_posts, then the count and the current post. @param array<string, mixed> $q

$qarray<string, mixed>

Internals 3

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatesingleStatus(): void#

A single post the reader may not see is dropped; a draft its editor may edit is a preview.

privatevisible(string|false $status): bool#

Whether the reader may see the first post in its status (a draft they may edit becomes a preview, dated now).

privatestickies(array $q): void#

Sticky posts to the front of the home listing's first page; those it did not find, fetched. @param array<string, mixed> $q

$qarray<string, mixed>