WordPress at Your Fingertips
function is not described

WC_Shortcode_Products::set_top_rated_products_query_args() protected WC 3.6.5

Set top rated products query args.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_top_rated_products_query_args( $query_args );
$query_args(array) (required) (passed by reference — &)
Query args.

Changelog

Since 3.6.5 Introduced.

Code of WC_Shortcode_Products::set_top_rated_products_query_args() WC 5.9.0

protected function set_top_rated_products_query_args( &$query_args ) {
	$query_args['meta_key'] = '_wc_average_rating'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
	$query_args['order']    = 'DESC';
	$query_args['orderby']  = 'meta_value_num';
}