Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp cache get

This page redirects to an external site: https://developer.wordpress.org/reference/functions/wp_cache_get/

Description

Retrieves the cache contents from the cache by key and group.

Usage

<code style="color: #000000"><span style="color: #0000BB"><?php wp_cache_get</span><span style="color: #007700">( </span><span style="color: #0000BB">$key</span><span style="color: #007700">, </span><span style="color: #0000BB">$group</span><span style="color: #007700">, </span><span style="color: #0000BB">$force</span><span style="color: #007700">, </span><span style="color: #0000BB">$found </span><span style="color: #007700">); </span><span style="color: #0000BB">?></span></code>

Parameters

$key
(int/string) (required) the key to indicate the value.
Default: None
$group
(string) (optional) this is a way of grouping data within the cache. Allows you to use the same key across different groups.
Default: None
$force
(boolean) (optional) Whether to force an update of the local cache from the persistent cache (default is false)
Default: false
$found
(&boolean) (optional) Whether key was found in the cache. Disambiguates a return of false, a storable value
Default: None

Return

False on failure to retrieve contents or the cache contents on success

Change Log

Since: 2.0.0

Source File

wp_cache_get() is located in wp-includes/cache.php.

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.