wp_cache_init

Definition:
function wp_cache_init() {}

Sets up Object Cache Global and assigns it.

Source code

function wp_cache_init() {

	$GLOBALS['wp_object_cache'] = new WP_Object_Cache();

}

3449

wp_cache_get

Definition:
function wp_cache_get( $key, $group = '', $force = false ) {}

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

Parameters

  • int|string $key: What the contents in the cache are called
  • string $group: Where the cache contents are grouped
  • bool $force: Whether to force an update of the local cache from the persistent cache (default is false)

Return values

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

Source code

function wp_cache_get( $key, $group = '', $force = false ) {

	global $wp_object_cache;



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

}

3447

wp_cache_flush

Definition:
function wp_cache_flush() {}

Removes all cache items.

Return values

returns:Always returns true

Source code

function wp_cache_flush() {

	global $wp_object_cache;



	return $wp_object_cache->flush();

}

3445

wp_cache_delete

Definition:
function wp_cache_delete($key, $group = '') {}

Removes the cache contents matching key and group.

Parameters

  • int|string $key: What the contents in the cache are called
  • string $group: Where the cache contents are grouped

Return values

returns:True on successful removal, false on failure

Source code

function wp_cache_delete($key, $group = '') {

	global $wp_object_cache;



	return $wp_object_cache->delete($key, $group);

}

3443

wp_cache_close

Definition:
function wp_cache_close() {}

Closes the cache.
This function has ceased to do anything since WordPress 2.5. The functionality was removed along with the rest of the persistent cache. This does not mean that plugins can’t implement this function when they need to make sure that the cache is cleaned up after WordPress no longer needs it.

Return values

returns:Always returns True

Source code

function wp_cache_close() {

	return true;

}

3441