Server : Apache System : Linux ls31.server.ly 3.10.0-962.3.2.lve1.5.68.el7.x86_64 #1 SMP Wed Apr 6 11:12:23 UTC 2022 x86_64 User : medchoco ( 2906) PHP Version : 8.3.16 Disable Function : mail Directory : /home/medchoco/www/wp-content/plugins/woocommerce/src/Internal/Admin/ProductReviews/ |
Upload File : |
<?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; } }