rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -29,13 +29,8 @@ function render_block_core_comments( $attributes, $content, $block ) {
return '';
}
$comment_args = array(
'post_id' => $post_id,
'count' => true,
'status' => 'approve',
);
// Return early if there are no comments and comments are closed.
if ( ! comments_open( $post_id ) && get_comments( $comment_args ) === 0 ) {
if ( ! comments_open( $post_id ) && (int) get_comments_number( $post_id ) === 0 ) {
return '';
}
@@ -212,6 +207,7 @@ function register_legacy_post_comments_block() {
* like `_wp_multiple_block_styles`, which is required in this case because
* the block has multiple styles.
*/
/** This filter is documented in wp-includes/blocks.php */
$metadata = apply_filters( 'block_type_metadata', $metadata );
register_block_type( 'core/post-comments', $metadata );