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



wp_cache_set › WordPress Function

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

Saves the data to the cache.

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


Source

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

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