wc_clear_template_cache()WC 4.3.0

Clear the template cache.

Хуков нет.

Возвращает

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

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

wc_clear_template_cache();

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

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

Код wc_clear_template_cache() 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' );
	}
}