Automattic\WooCommerce\Caches

ProductCountCache::is_cachedpublicWC 1.0

Check if the cache has a value for a given product type and status.

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

Хуков нет.

Возвращает

true|false.

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

$ProductCountCache = new ProductCountCache();
$ProductCountCache->is_cached( $product_type, $product_status ): bool;
$product_type(строка) (обязательный)
The post type (e.g. 'product', 'product_variation').
$product_status(строка) (обязательный)
The status of the product.

Код ProductCountCache::is_cached() WC 11.0.1

public function is_cached( string $product_type, string $product_status ): bool {
	return false !== wp_cache_get( $this->get_cache_key( $product_type, $product_status ) );
}