WP_Theme::cache_add()privateWP 3.4.0

Adds theme data to cache.

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

Метод класса: WP_Theme{}

Хуков нет.

Возвращает

true|false. Return value from wp_cache_add()

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

// private - только в коде основоного (родительского) класса
$result = $this->cache_add( $key, $data );
$key(строка) (обязательный)
Type of data to store (theme, screenshot, headers, post_templates)
$data(массив|строка) (обязательный)
Data to store

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

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

Код WP_Theme::cache_add() WP 6.5.2

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