WordPress at Your Fingertips
function is not described

WC_Discounts::set_items() public WC 3.2.3

Set items directly. Used by WC_Cart_Totals.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Discounts = new WC_Discounts();
$WC_Discounts->set_items( $items );
$items(array) (required)
Items to set.

Changelog

Since 3.2.3 Introduced.

Code of WC_Discounts::set_items() WC 5.6.0

public function set_items( $items ) {
	$this->items     = $items;
	$this->discounts = array();
	uasort( $this->items, array( $this, 'sort_by_price' ) );
}