Automattic\WooCommerce\Internal\Caches

ProductTermCacheInvalidator::handle_clean_taxonomy_cache │ public │ WC 11.2.0

Invalidate cached product terms after a taxonomy cache is cleaned.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ProductTermCacheInvalidator = new ProductTermCacheInvalidator();
$ProductTermCacheInvalidator->handle_clean_taxonomy_cache( $taxonomy ): void;
$taxonomy(разное) (обязательный)
Taxonomy name.

Список изменений

С версии 11.2.0 Введена.

Код ProductTermCacheInvalidator::handle_clean_taxonomy_cache() WC 11.2.2

public function handle_clean_taxonomy_cache( $taxonomy ): void {
	if ( ! is_string( $taxonomy ) || ! is_object_in_taxonomy( 'product', $taxonomy ) ) {
		return;
	}

	WC_Cache_Helper::invalidate_cache_group( 'product_terms_' . $taxonomy );
}