用于获取指定键的瞬态缓存值,适合在调试或检查缓存数据时使用。
| 参数 | 说明 |
|---|---|
<key> |
临时数据的键。 |
[--format=<format>] |
以特定格式渲染输出。默认:table。选项:table、csv、json、yaml。 |
[--network] |
获取网络/站点瞬态值。在单站点上,这是一个特殊命名的缓存键。在多站点上,这是一个全局缓存(而非站点本地缓存)。 |
$ wp transient get sample_key
test data
$ wp transient get random_key
Warning: Transient with key "random_key" is not set.