Automattic\WooCommerce\Caches
OrderCountCache::decrement
Decrement the cache value for a given order status.
Method of the class: OrderCountCache{}
No Hooks.
Returns
Int. The new value of the cache.
Usage
$OrderCountCache = new OrderCountCache(); $OrderCountCache->decrement( $order_type, $order_status, $offset );
- $order_type(string) (required)
- The type of order.
- $order_status(string) (required)
- The status of the order.
- $offset(int)
- The amount to decrement by.
Default:1
OrderCountCache::decrement() OrderCountCache::decrement code WC 10.7.0
public function decrement( $order_type, $order_status, $offset = 1 ) {
$cache_key = $this->get_cache_key( $order_type, $order_status );
return wp_cache_decr( $cache_key, $offset );
}