wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_cache_set › WordPress Function

Da2.0.0
Deprecaton/a
wp_cache_set ( $key, $data, $group = '', $expire = 0 )
Parametri: (4)
  • (int|string) $key The cache key to use for retrieval later.
    Richiesto:
  • (mixed) $data The contents to store in the cache.
    Richiesto:
  • (string) $group Optional. Where to group the cache contents. Enables the same key to be used across groups. Default empty.
    Richiesto: No
    Default: (vuoto)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Richiesto: No
    Default:
Vedi:
  • WP_Object_Cache::set()
Ritorna:
  • (bool) True on success, false on failure.
Definito a:
Codex:

Saves the data to the cache.

Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.


Sorgenti

function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {
	global $wp_object_cache;

	return $wp_object_cache->set( $key, $data, $group, (int) $expire );
}