Automattic\WooCommerce\Caches

ProductCountCache::decrement │ public │ WC 1.0

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

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

Хуков нет.

Возвращает

int|false.

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

$ProductCountCache = new ProductCountCache();
$ProductCountCache->decrement( $product_type, $product_status, $offset );
$product_type(строка) (обязательный)
The post type (e.g. 'product', 'product_variation').
$product_status(строка) (обязательный)
The status of the product.
$offset(int)
The amount to decrement by.
По умолчанию: 1

Код ProductCountCache::decrement() WC 11.2.2

public function decrement( string $product_type, string $product_status, int $offset = 1 ) {
	return wp_cache_decr( $this->get_cache_key( $product_type, $product_status ), $offset );
}