context['commentId'] ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes(); return sprintf( '
', $wrapper_attributes, get_comment_date( 'c', $block->context['commentId'] ), get_comment_date( isset( $attributes['format'] ) ? $attributes['format'] : '', $block->context['commentId'] ) ); } /** * Registers the `core/post-comment-date` block on the server. */ function gutenberg_register_block_core_post_comment_date() { register_block_type_from_metadata( __DIR__ . '/post-comment-date', array( 'render_callback' => 'gutenberg_render_block_core_post_comment_date', ) ); } add_action( 'init', 'gutenberg_register_block_core_post_comment_date', 20 );