Comments final readonly class
Minn\Blocks\Dynamic\Theme\Comments · public/minn/src/Minn/Blocks/Dynamic/Theme/Comments.php · 271 lines
comments, comments-title, comment-template, the comment-* blocks, and the comment form.
Uses 21 (show)
Constants and properties
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Content\Posts $posts | Promoted from the constructor. |
| private | readonly Minn\Content\Users $users | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Content\Posts $posts, Minn\Content\Users $users)# | ||||
| method | register(Minn\Blocks\Renderer $renderer): void# | Registers this family's blocks with the renderer. | |||
| static | query(array $vars): WP_Comment_Query# | The comment query a comment template's vars ask for, run once a request: the template and its pagination links ask for the same one, and the reference answers the repeat from its cache. A comment write drops it (RowCache).
|
Internals 15
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | comments(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | Nothing at all when the post has no comments and takes none. | |||
| private | title(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | template(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | records(array $comments, bool $threaded): array# | The query's comments as records, each followed by its replies when they are threaded; unthreaded, every one stands at the top level.
@return list<CommentRecord> | |||
| private | count(Minn\Content\PostRecord $post): int# | How many comments a post shows: its count, as get_comments_number filters it. | |||
| private | list(array $all, int $parent, int $depth, Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# |
| |||
| private | avatar(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | The comment author's avatar in a comment loop; elsewhere the post author's, linked to their posts when asked. | |||
| private | authorAvatar(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer, int $size): string# | ||||
| private | date(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | When the comment was written, in the format asked for (else the site's), linked to the comment unless isLink is off. | |||
| private | commentPost(Minn\Content\CommentRecord $comment, Minn\Blocks\Renderer $renderer): ?Minn\Content\PostRecord# | The post a comment belongs to: the loop's, or looked up when the comment came by itself (a comment block's render callback). | |||
| private | authorName(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | content(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | replyLink(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | form(Minn\Blocks\Block $block, Minn\Blocks\Renderer $renderer): string# | ||||
| private | commentForm(int $postId, Minn\Blocks\Block $block): string# | The form is comment_form()'s, as the reference's block renders it: the block theme's button in its defaults, the block's classes on the respond wrapper, and every comment_form hook a plugin uses to add its fields (a spam plugin's hidden check, a consent box) fired on the way. |
Nothing matches.