Make WordPress Core

Opened 4 years ago

#57732 new feature request

Add a filter for comment template block

Reported by: domainsupport Owned by:
Priority: normal Milestone: Awaiting Review
Component: Comments Version: 6.1.1
Severity: normal Keywords:
Cc: Focuses:

Description

It would be good to be able to filter the block content when rendering comments in the comment template block.

This would enable developers to inject content in / before / after specific comments.

Ideally something like this on line 68 of /wp-includes/blocks/comment-template.php ...

<?php

/**
 * Filters each comment before being added to the comment template block
 *
 * @since 6.2.0
 *
 * @param string $block_content The content of the comment block.
 * @param object $comment The comment object.
 */
$block_content = apply_filters( 'comment_template_comment_block_content', $block_content, $comment );

Would this be possible?

Thank you,

Oliver

Change History (0)

Note: See TracTickets for help on using tickets.