TransientSupport
in package
FinalYes
Boundary seam over the WordPress Transients API — TTL'd caching persisted in wp_options (or the object cache when a persistent backend is wired).
No-ops (returning false) outside a WP runtime.
Table of Contents
Methods
- delete() : bool
- get() : mixed
- remember() : mixed
- Read-through helper: return the cached value or produce, store and return it.
- set() : bool
Methods
delete()
public
static delete(string $key) : bool
Parameters
- $key : string
Return values
boolget()
public
static get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —false when absent/expired (WP convention)
remember()
Read-through helper: return the cached value or produce, store and return it.
public
static remember(string $key, int $expirationSeconds, callable $producer) : mixed
Parameters
- $key : string
- $expirationSeconds : int
- $producer : callable
set()
public
static set(string $key, mixed $value[, int $expirationSeconds = 0 ]) : bool
Parameters
- $key : string
- $value : mixed
- $expirationSeconds : int = 0
-
0 = no expiration