Commit 7656cba45c0 for woocommerce

commit 7656cba45c0595adc39a63ec2756c5efad1be303
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date:   Thu Nov 12 08:53:10 2026 +0100

    Restore comments_clauses_without_product_reviews signature with second argument being optional (#70863)

    * Restore modify_product_review_moderation_urls signature with second argument being optional

    * Add changelog file

diff --git a/plugins/woocommerce/changelog/fix-70829 b/plugins/woocommerce/changelog/fix-70829
new file mode 100644
index 00000000000..4e20844a25f
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-70829
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Restore comments_clauses_without_product_reviews signature with second argument being optional
diff --git a/plugins/woocommerce/src/Internal/Admin/ProductReviews/ReviewsUtil.php b/plugins/woocommerce/src/Internal/Admin/ProductReviews/ReviewsUtil.php
index 76d6674158f..7bdff65b59c 100644
--- a/plugins/woocommerce/src/Internal/Admin/ProductReviews/ReviewsUtil.php
+++ b/plugins/woocommerce/src/Internal/Admin/ProductReviews/ReviewsUtil.php
@@ -38,14 +38,18 @@ class ReviewsUtil {
 	/**
 	 * Removes product reviews from the edit-comments page to fix the "Mine" tab counter.
 	 *
-	 * @param array|mixed       $clauses A compacted array of comment query clauses.
-	 * @param \WP_Comment_Query $comment_query The WP_Comment_Query instance being filtered.
+	 * @param array|mixed            $clauses       A compacted array of comment query clauses.
+	 * @param \WP_Comment_Query|null $comment_query The comment query being filtered, when provided.
 	 *
 	 * @return array|mixed
 	 */
-	public static function comments_clauses_without_product_reviews( $clauses, $comment_query ) {
+	public static function comments_clauses_without_product_reviews( $clauses, $comment_query = null ) {
 		global $wpdb;

+		if ( ! $comment_query instanceof \WP_Comment_Query ) {
+			return $clauses;
+		}
+
 		if ( ! empty( $comment_query->query_vars['post_type'] ) ) {
 			$post_type = $comment_query->query_vars['post_type'];
 			if ( ! is_array( $post_type ) ) {