Enable the legacy comments block in WordPress 6.0

Enable the legacy comments block in WordPress 6.0 on child sites.

Snippet Type

Execute on Child Sites

Snippet

function wporg_enable_post_comments_legacy_block( $metadata ) {
    if ( 'core/post-comments' === $metadata['name'] ) {
        $metadata['title'] = esc_html__( 'Post Comments', 'textdomain' );
    $metadata['supports']['inserter'] = true;
    }
    return $metadata;
}
add_filter( 'block_type_metadata', 'wporg_enable_post_comments_legacy_block' );;