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



wp_cache_set_multiple_salted › WordPress Function

Seit6.9.0
Veraltetn/v
wp_cache_set_multiple_salted ( $data, $group, $salt, $expire = 0 )
Parameter: (4)
  • (mixed) $data Data to be stored in the cache for all keys.
    Erforderlich: Ja
  • (string) $group Group to which the cached data belongs.
    Erforderlich: Ja
  • (string|string[]) $salt The timestamp (or multiple timestamps if an array) indicating when the cache group(s) were last updated.
    Erforderlich: Ja
  • (int) $expire Optional. When to expire the cache contents, in seconds. Default 0 (no expiration).
    Erforderlich: Nein
    Standard:
Gibt zurück:
  • (bool[]) Array of return values, grouped by key. Each value is either true on success, or false on failure.
Definiert in:
Codex:

Stores multiple pieces of salted data in the cache.



Quellcode

function wp_cache_set_multiple_salted( $data, $group, $salt, $expire = 0 ) {
		$salt      = is_array( $salt ) ? implode( ':', $salt ) : $salt;
		$new_cache = array();
		foreach ( $data as $key => $value ) {
			$new_cache[ $key ] = array(
				'data' => $value,
				'salt' => $salt,
			);
		}
		return wp_cache_set_multiple( $new_cache, $group, $expire );
	}
endif;