Commit db8d425e41 for wordpress.org
commit db8d425e41446c5f396d6a5a33cbcf730c08bf9b
Author: Sergey Biryukov <sergeybiryukov.ru@gmail.com>
Date: Mon Dec 1 15:33:32 2025 +0000
Notes: Avoid incrementing `comment_count` when notes are resolved or reopened.
Follow-up to [60987].
Props hbhalodia, wildworks, shimotomoki, gulamdastgir04, JeffPaul, ellatrix, SergeyBiryukov.
Fixes #64325.
Built from https://develop.svn.wordpress.org/trunk@61336
git-svn-id: http://core.svn.wordpress.org/trunk@60648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 36dea1418d..7ce4976523 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -2872,7 +2872,7 @@ function wp_update_comment_count_now( $post_id ) {
$new = apply_filters( 'pre_wp_update_comment_count_now', null, $old, $post_id );
if ( is_null( $new ) ) {
- $new = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id ) );
+ $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 ) );
} else {
$new = (int) $new;
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 4a0d66c48e..a67b624a41 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61329';
+$wp_version = '7.0-alpha-61336';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.