WordPress at a glance

wp_cache_get() WP 1.0

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

  • See: WP_Object_Cache::get()
  • Global. WP_Object_Cache. $wp_object_cache Object cache global instance.
Is the basis for: wp_load_alloptions()
Works based on: WP_Object_Cache::get()
✈ 1 time = 0.000001s = speed of light | 50000 times = 0.054485s = speed of light | PHP 7.1.11, WP 4.9.8

No Hooks.


true/false/Mixed. False on failure to retrieve contents or the cache contents on success


wp_cache_get( $key, $group, $force, &$found );
$key(int/string) (required)
The key under which the cache contents are stored.
Where the cache contents are grouped.
Default: ''
Whether to force an update of the local cache from the persistent cache.
Default: false
$found(true/false) (required)
Whether the key was found in the cache (passed by reference). Disambiguates a return of false, a storable value.
Default: null

Code of wp cache get: wp-includes/cache.php VER 5.1.1

function wp_cache_get( $key, $group = '', $force = false, &$found = null ) {
	global $wp_object_cache;

	return $wp_object_cache->get( $key, $group, $force, $found );

Related Functions

From tag: cache (caching)

No comments
    Hello, !     Log In . Register