wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_cache_add › WordPress Function

Depuis2.0.0
Dépréciéen/a
wp_cache_add ( $key, $data, $group = '', $expire = 0 )
Paramètres: (4)
  • (int|string) $key The cache key to use for retrieval later.
    Requis: Oui
  • (mixed) $data The data to add to the cache.
    Requis: Oui
  • (string) $group Optional. The group to add the cache to. Enables the same key to be used across groups. Default empty.
    Requis: Non
    Défaut: (vide)
  • (int) $expire Optional. When the cache data should expire, in seconds. Default 0 (no expiration).
    Requis: Non
    Défaut:
Voir:
  • WP_Object_Cache::add()
Retourne:
  • (bool) True on success, false if cache key and group already exist.
Défini(e) dans:
Codex:

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



Source

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

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