wc_clear_template_cache()WC 4.3.0

Clear the template cache.

No Hooks.

Return

null. Nothing (null).

Usage

wc_clear_template_cache();

Changelog

Since 4.3.0 Introduced.

wc_clear_template_cache() code WC 8.7.0

function wc_clear_template_cache() {
	$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
	if ( is_array( $cached_templates ) ) {
		foreach ( $cached_templates as $cache_key ) {
			wp_cache_delete( $cache_key, 'woocommerce' );
		}

		wp_cache_delete( 'cached_templates', 'woocommerce' );
	}
}