WP_Object_Cache::get

SummerySummery

Retrieves the cache contents, if it exists.

Syntax

WP_Object_Cache::get( int|string $key, string $group = 'default', bool $force = false, bool $found = null )

DescriptionDescription

The contents will be first attempted to be retrieved by searching by the key in the cache group. If the cache is hit (success) then the contents are returned.

On failure, the number of cache misses will be incremented.

ParametersParameters

$key

(int|string) (Required) What the contents in the cache are called.

$group

(string) (Optional) Where the cache contents are grouped.

Default value: 'default'

$force

(bool) (Optional) Unused. Whether to force a refetch rather than relying on the local cache.

Default value: false

$found

(bool) (Optional) Whether the key was found in the cache (passed by reference). Disambiguates a return of false, a storable value.

Default value: null

ReturnReturn

(mixed|false) The cache contents on success, false on failure to retrieve contents.

SourceSource

File: wp-includes/class-wp-object-cache.php


			

ChangelogChangelog

Changelog
Version Description
2.0.0 Introduced.
Scroll to Top