Skip to content

Commit 4c2df28

Browse files
committed
GH-64325 Add the condition to filter comment type when showing comment count
1 parent d676a07 commit 4c2df28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,7 @@ function wp_update_comment_count_now( $post_id ) {
28722872
$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );
28732873

28742874
if ( is_null( $new ) ) {
2875-
$new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id ) );
2875+
$new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' AND comment_type != 'note'", $post_id ) );
28762876
} else {
28772877
$new = (int) $new;
28782878
}

0 commit comments

Comments
 (0)