WPDev.one
Core Function
View Source on Trac ↗

wp_cache_replace()

wp_cache_replace( mixed $key, mixed $data, mixed $group = '', mixed $expire = 0 )

Replaces the contents of the cache with new data.

Parameters 4 required

Name / Type Description
(int

| string) $key The key for the cache data that should be replaced.

Required
$data
mixed

The new data to store in the cache.

Required
string

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

Required
int

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

Required

Return Value

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

Function Information

Since Version
2.0.0
Source File
wp-includes/cache.php
Advertisement