Commit f3cf7c51659 for woocommerce
commit f3cf7c51659fd87c4013d32ad64ee1768579bd30
Author: Akanshu Singh <61490175+singhakanshu00@users.noreply.github.com>
Date: Mon Nov 9 23:29:18 2026 +0530
fix: Fixes reaction comments affecting cached comment counts (#70122)
* fix: Fixes reaction comments affecting cached comment counts
* reduce test
---------
Co-authored-by: Luigi Teschio <gigitux@gmail.com>
diff --git a/plugins/woocommerce/changelog/fix-exclude-reactions-from-comment-counts b/plugins/woocommerce/changelog/fix-exclude-reactions-from-comment-counts
new file mode 100644
index 00000000000..0a4351f3019
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-exclude-reactions-from-comment-counts
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Exclude block editor note reactions from the cached comment counts.
diff --git a/plugins/woocommerce/includes/class-wc-comments.php b/plugins/woocommerce/includes/class-wc-comments.php
index 574e89d6ca0..f2f2a6eac0b 100644
--- a/plugins/woocommerce/includes/class-wc-comments.php
+++ b/plugins/woocommerce/includes/class-wc-comments.php
@@ -342,7 +342,7 @@ class WC_Comments {
* @return bool
*/
private static function is_comment_excluded_from_wp_comment_counts( $comment ) {
- return in_array( $comment->comment_type, array( 'action_log', 'note', 'order_note', 'webhook_delivery' ), true )
+ return in_array( $comment->comment_type, array( 'action_log', 'note', 'order_note', 'reaction', 'webhook_delivery' ), true )
|| get_post_type( $comment->comment_post_ID ) === 'product';
}
diff --git a/plugins/woocommerce/tests/php/includes/class-wc-comments-test.php b/plugins/woocommerce/tests/php/includes/class-wc-comments-test.php
index bfc8e393d40..235dd7092e6 100644
--- a/plugins/woocommerce/tests/php/includes/class-wc-comments-test.php
+++ b/plugins/woocommerce/tests/php/includes/class-wc-comments-test.php
@@ -158,6 +158,7 @@ class WC_Comments_Tests extends \WC_Unit_Test_Case {
* @testWith ["action_log"]
* ["note"]
* ["order_note"]
+ * ["reaction"]
* ["webhook_delivery"]
*
* @param string $comment_type Comment type that should be excluded from the counts.