Automattic\WooCommerce\Caches
ProductCountCache::increment
Increment 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->increment( $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 increment by.
Default:1
ProductCountCache::increment() ProductCountCache::increment code WC 11.0.0
public function increment( string $product_type, string $product_status, int $offset = 1 ) {
return wp_cache_incr( $this->get_cache_key( $product_type, $product_status ), $offset );
}