Automattic\WooCommerce\Caches

OrderCountCache::setpublicWC 1.0

Set the cache value for a given order type and status.

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

Хуков нет.

Возвращает

true|false. True if the value was set, false otherwise.

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

$OrderCountCache = new OrderCountCache();
$OrderCountCache->set( $order_type, $order_status, $value ): bool;
$order_type(строка) (обязательный)
The type of order.
$order_status(строка) (обязательный)
The status slug of the order.
$value(int) (обязательный)
The value to set.

Код OrderCountCache::set() WC 11.0.1

public function set( $order_type, $order_status, int $value ): bool {
	$this->ensure_statuses_for_type( (string) $order_type, array( (string) $order_status ) );
	$cache_key = $this->get_cache_key( $order_type, $order_status );
	return wp_cache_set( $cache_key, $value, '', $this->expiration );
}