WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Object_Cache::set() public WP 2.0.0

Sets the data contents into the cache.

The cache contents are grouped by the $group parameter followed by the $key. This allows for duplicate IDs in unique groups. Therefore, naming of the group should be used with care and should follow normal function naming guidelines outside of core WordPress usage.

The $expire parameter is not used, because the cache will automatically expire for each time a page is accessed and PHP finishes. The method is more for cache plugins which use files.

Это метод класса: WP_Object_Cache{}

Хуков нет.

Возвращает

true. Always returns true.

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

$WP_Object_Cache = new WP_Object_Cache();
$WP_Object_Cache->set( $key, $data, $group, $expire );
$key(число/строка) (обязательный)
What to call the contents in the cache.
$data(смешанный) (обязательный)
The contents to store in the cache.
$group(строка)
Where to group the cache contents.
По умолчанию: 'default'
$expire(число)
Not Used.
По умолчанию: 0

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

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

Код WP_Object_Cache::set() WP 5.5.1

wp-includes/class-wp-object-cache.php
<?php
public function set( $key, $data, $group = 'default', $expire = 0 ) {
	if ( empty( $group ) ) {
		$group = 'default';
	}

	if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
		$key = $this->blog_prefix . $key;
	}

	if ( is_object( $data ) ) {
		$data = clone $data;
	}

	$this->cache[ $group ][ $key ] = $data;
	return true;
}