Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsUtil::comments_clauses_without_product_reviews()public staticWC 1.0

Removes product reviews from the edit-comments page to fix the "Mine" tab counter.

{} Это метод класса: ReviewsUtil{}

Хуков нет.

Возвращает

Массив|Разное.

Использование

$result = ReviewsUtil::comments_clauses_without_product_reviews( $clauses );
$clauses(массив|разное) (обязательный)
A compacted array of comment query clauses.

Код ReviewsUtil::comments_clauses_without_product_reviews() WC 6.7.0

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;
}