PHP 8.2.31
Preview: ReviewsUtil.php Size: 861 B
/home/nshryvcy/himaltourism.com/wp-content/plugins/woocommerce/src/Internal/Admin/ProductReviews/ReviewsUtil.php

<?php

namespace Automattic\WooCommerce\Internal\Admin\ProductReviews;

/**
 * A utility class for handling comments that are product reviews.
 */
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.
	 * @return array|mixed
	 */
	public static function comments_clauses_without_product_reviews( $clauses ) {
		global $wpdb, $current_screen;

		if ( isset( $current_screen->base ) && 'edit-comments' === $current_screen->base ) {
			$clauses['join']  .= " LEFT JOIN {$wpdb->posts} AS wp_posts_to_exclude_reviews ON comment_post_ID = wp_posts_to_exclude_reviews.ID ";
			$clauses['where'] .= ( $clauses['where'] ? ' AND ' : '' ) . " wp_posts_to_exclude_reviews.post_type NOT IN ('product') ";
		}

		return $clauses;
	}
}

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
20.90 KB lrw-r--r-- 2026-03-03 06:10:19
Edit Download
4.13 KB lrw-r--r-- 2026-03-03 06:10:19
Edit Download
45.61 KB lrw-r--r-- 2026-03-03 06:10:19
Edit Download
861 B lrw-r--r-- 2026-03-03 06:10:19
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).