<?php
function block_core_comment_template_render_comments( $comments, $block ) {
global $comment_depth;
$thread_comments = get_option( 'thread_comments' );
$thread_comments_depth = get_option( 'thread_comments_depth' );
if ( empty( $comment_depth ) ) {
$comment_depth = 1;
}
$content = '';
foreach ( $comments as $comment ) {
$comment_id = $comment->comment_ID;
$filter_block_context = static function ( $context ) use ( $comment_id ) {
$context['commentId'] = $comment_id;
return $context;
};
add_filter( 'render_block_context', $filter_block_context, 1 );