[wp-trac] [WordPress Trac] #57732: Add a filter for comment template block

WordPress Trac noreply at wordpress.org
Thu Feb 16 10:01:03 UTC 2023


#57732: Add a filter for comment template block
-----------------------------+-----------------------------
 Reporter:  domainsupport    |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Comments         |    Version:  6.1.1
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 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
 <?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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57732>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list