Core Function
View Source on Trac ↗ wp_cache_set()
wp_cache_set( mixed $key, mixed $data, mixed $group = '', mixed $expire = 0 ) Saves the data to the cache.
Parameters 4 required
| Name / Type | Description |
|---|---|
| (int | | string) $key The cache key to use for retrieval later. Required |
| $data mixed | The contents to store in the cache. Required |
| string | $group Optional. Where to group the cache contents. Enables the same key to be used across groups. Default empty. Required |
| int | $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration). Required |
Return Value
(bool)
True on success, false on failure.
Function Information
Since Version
2.0.0
Source File
wp-includes/cache.php
Advertisement