CacheEngine::cache_object()publicWC 1.0

Caches an object under a given key, and with a given expiration.

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

No Hooks.


true|false. True if the object is cached successfully, false otherwise.


$CacheEngine = new CacheEngine();
$CacheEngine->cache_object( $key, $object, $expiration ): bool;
$key(string) (required)
The key under which the object will be cached.
$object(array|object) (required)
The object to cache.
$expiration(int) (required)
Expiration for the cached object, in seconds.

Code of CacheEngine::cache_object() WC 7.1.0

public function cache_object( string $key, $object, int $expiration): bool;