WP_AI_Client_Cache::set │ public │ WP 7.0.0

Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.

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

Хуков нет.

Возвращает

bool. True on success and false on failure.

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

$WP_AI_Client_Cache = new WP_AI_Client_Cache();
$WP_AI_Client_Cache->set( $key, $value, $ttl ): bool;
$key(строка) (обязательный)
The key of the item to store.
$value(разное) (обязательный)
The value of the item to store, must be serializable.
$ttl(null|int|DateInterval)
The TTL value of this item.
По умолчанию: null

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

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

Код WP_AI_Client_Cache::set() WP 7.1.2

public function set( $key, $value, $ttl = null ): bool {
	$expire = $this->ttl_to_seconds( $ttl );

	return wp_cache_set( $key, $value, $this->get_cache_group(), $expire );
}