wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_cache_add › WordPress Function

Od2.0.0
Przestarzałyn/a
wp_cache_add ( $key, $data, $group = '', $expire = 0 )
Parametry: (4)
  • (int|string) $key The cache key to use for retrieval later.
    Wymagane: Tak
  • (mixed) $data The data to add to the cache.
    Wymagane: Tak
  • (string) $group Optional. The group to add the cache to. Enables the same key to be used across groups. Default empty.
    Wymagane: Nie
    Domyślny: (puste)
  • (int) $expire Optional. When the cache data should expire, in seconds. Default 0 (no expiration).
    Wymagane: Nie
    Domyślny:
Zobacz:
  • WP_Object_Cache::add()
Powrót:
  • (bool) True on success, false if cache key and group already exist.
Zdefiniowane na:
Codex:

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



Źródło

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

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