WordPress\AiClientDependencies\Psr\SimpleCache

CacheInterface::set │ public │ WP 1.0

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

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

Хуков нет.

Возвращает

bool. True on success and false on failure.

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

$CacheInterface = new CacheInterface();
$CacheInterface->set( $key, $value, $ttl );
$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. If no value is sent and the driver supports TTL then the library may set a default value for it or let the driver take care of that.
По умолчанию: null

Код CacheInterface::set() WP 7.1.4

public function set($key, $value, $ttl = null);