Automattic\WooCommerce\Caches
ProductCountCache::is_cached
Check if the cache has a value for a given product type and status.
Method of the class: ProductCountCache{}
No Hooks.
Returns
true|false.
Usage
$ProductCountCache = new ProductCountCache(); $ProductCountCache->is_cached( $product_type, $product_status ): bool;
- $product_type(string) (required)
- The post type (e.g.
'product', 'product_variation'). - $product_status(string) (required)
- The status of the product.
ProductCountCache::is_cached() ProductCountCache::is cached code WC 11.0.0
public function is_cached( string $product_type, string $product_status ): bool {
return false !== wp_cache_get( $this->get_cache_key( $product_type, $product_status ) );
}