wp_cache_replace() – Function | Developer.WordPress.org

Replaces the contents of the cache with new data.

Description

See also

Parameters

$keyint|stringrequired

The key for the cache data that should be replaced.

$datamixedrequired

The new data to store in the cache.

$groupstringoptional

The group for the cache data that should be replaced.
Default empty.

$expireintoptional

When to expire the cache contents, in seconds.
Default 0 (no expiration).

Return

bool True if contents were replaced, false if original value does not exist.

Source

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

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

View all references View on Trac View on GitHub

Changelog

VersionDescription
2.0.0Introduced.