wp_cache_set


wp_cache_set ( $key, $data, $group = '', $expire = 0 )

Parameters:
  • (int|string) key The cache key to use for retrieval later.
  • (mixed) data The contents to store in the cache.
  • (string) group Optional. Where to group the cache contents. Enables the same key to be used across groups. Default empty.
  • (int) expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
See:
  • WP_Object_Cache::set()
Returns:
  • (bool) True on success, false on failure.
Defined at:

Description

Saves the data to the cache.Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.

Related Functions

wp_cache_get, wp_cache_reset, wp_cache_close, wp_cache_delete, wp_cache_init

Top Google Results

User discussions

wpseek mobile