Server IP : 192.158.238.246 / Your IP : 3.143.110.165 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/task/7779/cwd/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; } }