WC_Query::order_by_rating_post_clauses()publicWC 1.0

Order by rating post clauses.

Метод класса: WC_Query{}

Хуков нет.

Возвращает

Массив.

Использование

$WC_Query = new WC_Query();
$WC_Query->order_by_rating_post_clauses( $args );
$args(массив) (обязательный)
Query args.

Код WC_Query::order_by_rating_post_clauses() WC 8.7.0

public function order_by_rating_post_clauses( $args ) {
	$args['join']    = $this->append_product_sorting_table_join( $args['join'] );
	$args['orderby'] = ' wc_product_meta_lookup.average_rating DESC, wc_product_meta_lookup.rating_count DESC, wc_product_meta_lookup.product_id DESC ';
	return $args;
}