Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_cache_set ›

Seit2.0.0
Veraltetn/v
wp_cache_set ( $key, $data, $group = '', $expire = 0 )
Parameter: (4)
  • (int|string) $key The cache key to use for retrieval later.
    Erforderlich: Ja
  • (mixed) $data The contents to store in the cache.
    Erforderlich: Ja
  • (string) $group Optional. Where to group the cache contents. Enables the same key to be used across groups. Default empty.
    Erforderlich: Nein
    Standard: (leer)
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Erforderlich: Nein
    Standard:
Siehe:
  • WP_Object_Cache::set()
Gibt zurück:
  • (bool) False on failure, true on success
Definiert in:
Codex:

Saves the data to the cache.

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



Quellcode

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

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