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



wp_cache_add ›

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

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



Quellcode

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

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