Automattic\WooCommerce\Blocks\BlockTypes

ProductTopRated::set_block_query_args()protectedWC 1.0

Force orderby to rating.

Method of the class: ProductTopRated{}

No Hooks.

Return

null. Nothing (null).

Usage

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

ProductTopRated::set_block_query_args() code WC 9.0.1

protected function set_block_query_args( &$query_args ) {
	$query_args['orderby'] = 'rating';
}