Automattic\WooCommerce\Caches

ProductCountCache::decrementpublicWC 1.0

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

Method of the class: ProductCountCache{}

No Hooks.

Returns

int|false.

Usage

$ProductCountCache = new ProductCountCache();
$ProductCountCache->decrement( $product_type, $product_status, $offset );
$product_type(string) (required)
The post type (e.g. 'product', 'product_variation').
$product_status(string) (required)
The status of the product.
$offset(int)
The amount to decrement by.
Default: 1

ProductCountCache::decrement() code WC 11.0.1

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 );
}