TermBlocks final readonly class
Minn\Blocks\Dynamic\Theme\TermBlocks · public/minn/src/Minn/Blocks/Dynamic/Theme/TermBlocks.php · 71 lines
term-name, term-count and term-description: the term a block's context names (termId and taxonomy, as a terms query provides them), else the term archive being viewed; nothing for neither (probe core-blocks).
Constants and properties
| private | BRACKETS = array ( 'round' => array ( 0 => '(', 1 => ')', ), 'square' => array ( 0 => '[', 1 => ']', ), 'curly' => array ( 0 => '{', 1 => '}', ), 'angle' => array ( 0 => '<', 1 => '>', ), 'none' => array ( 0 => '', 1 => '', ), ) | |
| private | readonly Minn\Content\Terms $terms | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
Public
Internals 4
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | name(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | The name, as a paragraph or the heading level asked for, linked to its archive when asked. |
| private | count(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | How many posts the term holds, in the brackets asked for (round by default). |
| private | description(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | The description as written for a term in context; a term archive's as a paragraph, the way term_description gives it. |
| private | term(Minn\Blocks\Renderer $renderer): array# | @return array{?TermRecord, bool} the term, and whether the block's context named it |
Nothing matches.