QueryBlocks final class
Minn\Blocks\Dynamic\Theme\QueryBlocks · public/minn/src/Minn/Blocks/Dynamic/Theme/QueryBlocks.php · 283 lines
query, post-template, query-title, query-no-results, query-pagination, query-total.
Constants and properties
| private | array $queries | |
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
Public
Internals 13
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | query(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | The query wrapper is stored markup; the block sets the loop its children read. | |||
| private | queried(Minn\Blocks\Block $block, array $attrs, int $page): Minn\Content\Page# | A query loop's posts as the reference finds them: the arguments build_query_vars_from_query_block makes of the block's query (through query_loop_block_query_vars) for the page its query-{id}-page asks for, run through WP_Query, so pre_get_posts and the posts_* filters shape it too.
| |||
| private | loop(Minn\Blocks\Block $block, array $attrs, Minn\Blocks\Renderer $renderer): array# | A loop as the query block sets it: the main query's page when it inherits, else its own query for the page its query-{id}-page asks for.
@return array{page: Page, inherit: bool, paged: int, perPage: int} | |||
| private | current(?Minn\Blocks\Renderer $renderer = NULL): array# | The innermost loop being rendered; outside one, the loop a block's context provides (a post template called by its render callback). | |||
| private | total(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | How many posts the loop found, or which of them this page shows (displayType range-display). | |||
| private | postTemplate(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | postClasses(Minn\Content\PostRecord $post, bool $sticky): array# | @return list<string> | |||
| private | queryTitle(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | noResults(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | pagination(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | Pagination renders only when the loop it belongs to has more than one page. | |||
| private | paginationBase(Minn\Blocks\Renderer $renderer): string# | The current listing's own URL, without a page number. | |||
| private | numbers(int $paged, int $pages, callable $link): string# |
| |||
| private | archiveTitle(array $type): string# | A post type archive's title: the type's label, renamed by the post_type_archive_title filter when a plugin does. |
Nothing matches.