wp_cache_set_salted()WP 6.9.0

Stores salted data in the cache.

Хуков нет.

Возвращает

true|false. True on success, false on failure.

Использование

wp_cache_set_salted( $cache_key, $data, $group, $salt, $expire );
$cache_key(строка) (обязательный)
The cache key under which to store the data.
$data(разное) (обязательный)
The data to be cached.
$group(строка) (обязательный)
The cache group to which the data belongs.
$salt(строка|string[]) (обязательный)
The timestamp (or multiple timestamps if an array) indicating when the cache group(s) were last updated.
$expire(int)
When to expire the cache contents, in seconds.
По умолчанию: 0 (no expiration)

Список изменений

С версии 6.9.0 Введена.

Код wp_cache_set_salted() WP 7.0.4

function wp_cache_set_salted( $cache_key, $data, $group, $salt, $expire = 0 ) {
	$salt = is_array( $salt ) ? implode( ':', $salt ) : $salt;
	return wp_cache_set(
		$cache_key,
		array(
			'data' => $data,
			'salt' => $salt,
		),
		$group,
		$expire
	);
}