Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_filter_rating_arguments()protectedWC 1.0

Builds the meta_query arguments based on the current request.

{} It's a method of the class: ReviewsListTable{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_filter_rating_arguments() : array;

Code of ReviewsListTable::get_filter_rating_arguments() WC 7.1.0

protected function get_filter_rating_arguments() : array {

	$args = [];

	if ( empty( $this->current_reviews_rating ) ) {
		return $args;
	}

	$args['meta_query'] = [
		[
			'key'     => 'rating',
			'value'   => (int) $this->current_reviews_rating,
			'compare' => '=',
			'type'    => 'NUMERIC',
		],
	];

	return $args;
}