Automattic\WooCommerce\Blocks\BlockTypes

ProductTopRated{}WC 1.0

ProductTopRated class.

Хуков нет.

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

$ProductTopRated = new ProductTopRated();
// use class methods

Методы

  1. protected set_block_query_args( &$query_args )

Код ProductTopRated{} WC 7.1.0

class ProductTopRated extends AbstractProductGrid {

	/**
	 * Block name.
	 *
	 * @var string
	 */
	protected $block_name = 'product-top-rated';

	/**
	 * Force orderby to rating.
	 *
	 * @param array $query_args Query args.
	 */
	protected function set_block_query_args( &$query_args ) {
		$query_args['orderby'] = 'rating';
	}
}