wp_cache_add


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

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

Description

Adds data to the cache, if the cache key doesn't already exist.

Related Functions

wp_cache_decr, wp_cache_get, wp_cache_set, wp_cache_delete, wp_head

Top Google Results

User discussions

wpseek mobile