WP_Theme::cache_add()privateWP 3.4.0

Adds theme data to cache.

Cache entries keyed by the theme and the type of data.

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.

WP_Theme::cache_add() code WP 6.5.2

private function cache_add( $key, $data ) {
	return wp_cache_add( $key . '-' . $this->cache_hash, $data, 'themes', self::$cache_expiration );
}