Automattic\WooCommerce\Internal\Caches
ProductTermCacheInvalidator::handle_clean_taxonomy_cache
Invalidate cached product terms after a taxonomy cache is cleaned.
Method of the class: ProductTermCacheInvalidator{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ProductTermCacheInvalidator = new ProductTermCacheInvalidator(); $ProductTermCacheInvalidator->handle_clean_taxonomy_cache( $taxonomy ): void;
- $taxonomy(mixed) (required)
- Taxonomy name.
Changelog
| Since 11.2.0 | Introduced. |
ProductTermCacheInvalidator::handle_clean_taxonomy_cache() ProductTermCacheInvalidator::handle clean taxonomy cache code WC 11.2.1
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 );
}