wp_cache_replace

Advertisement

Summery Summery

Replaces the contents of the cache with new data.

Syntax Syntax

wp_cache_replace( int|string $key, mixed $data, string $group = '', int $expire )

Parameters Parameters

$key

(Required) The key for the cache data that should be replaced.

$data

(Required) The new data to store in the cache.

$group

(Optional) The group for the cache data that should be replaced.

Default value: ''

$expire

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

Return Return

(bool) False if original value does not exist, true if contents were replaced

Source Source

File: wp-includes/cache.php

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

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

See also See also

Advertisement

Leave a Reply