Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::get_filter_rating_arguments()protectedWC 1.0

Builds the meta_query arguments based on the current request.

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;

ReviewsListTable::get_filter_rating_arguments() code WC 8.6.1

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