render_block_core_comments
render_block_core_comments ( $attributes, $content, $block )
Parameters:- (array) attributes Block attributes.
- (string) content Block default content.
- (WP_Block) block Block instance.
Returns:- (string) Returns the filtered post comments for the current post wrapped inside "p" tags.
Defined at: - Introduced in WordPress: 6.1.0
- Deprecated in WordPress: —
Description
Renders the `core/comments` block on the server.This render callback is mainly for rendering a dynamic, legacy version of
this block (the old `core/post-comments`). It uses the `comments_template()`
function to generate the output, in the same way as classic PHP themes.
As this callback will always run during SSR, first we need to check whether
the block is in legacy mode. If not, the HTML generated in the editor is
returned instead.