Automattic\WooCommerce\Caches

ProductCountCache::setpublicWC 1.0

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

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

Хуков нет.

Возвращает

true|false.

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

$ProductCountCache = new ProductCountCache();
$ProductCountCache->set( $product_type, $product_status, $value ): bool;
$product_type(строка) (обязательный)
The post type (e.g. 'product', 'product_variation').
$product_status(строка) (обязательный)
The status slug of the product.
$value(int) (обязательный)
The value to set.

Код ProductCountCache::set() WC 11.0.1

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