wc_set_template_cache( string $cache_key, string $template )
Add a template to the template cache.
Description Description
Parameters Parameters
- $cache_key
-
(Required) Object cache key.
- $template
-
(Required) Located template.
Source Source
File: includes/wc-core-functions.php
function wc_set_template_cache( $cache_key, $template ) { wp_cache_set( $cache_key, $template, 'woocommerce' ); $cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' ); if ( is_array( $cached_templates ) ) { $cached_templates[] = $cache_key; } else { $cached_templates = array( $cache_key ); } wp_cache_set( 'cached_templates', $cached_templates, 'woocommerce' ); }
Changelog Changelog
Version | Description |
---|---|
4.3.0 | Introduced. |