WP_Theme::cache_add() private WP 3.4.0
Adds theme data to cache.
Cache entries keyed by the theme and the type of data.
{} It's a method of the class: WP_Theme{}
No Hooks.
Return
true/false. Return value from wp_cache_add()
Usage
// private - for code of main (parent) class only $result = $this->cache_add( $key, $data );
- $key(string) (required)
- Type of data to store (theme, screenshot, headers, post_templates)
- $data(array/string) (required)
- Data to store
Changelog
Since 3.4.0 | Introduced. |
Code of WP_Theme::cache_add() WP Theme::cache add WP 5.6
private function cache_add( $key, $data ) {
return wp_cache_add( $key . '-' . $this->cache_hash, $data, 'themes', self::$cache_expiration );
}