This caches WordPress data like options, user data, pages, etc. It should be noted that it is used only if cache is enabled.

It is an instance of class WP_Object_Cache defined in [wordpress root folder]/wp-includes/cache.php. WordPress provides functions to operate on this variable, this variable need not be accessed directly. It is possible that even these functions are not required to be accessed directly by the plugin author, they are invoked internally by lot of WordPress functions. The functions are:

  • wp_cache_add($key, $data, $flag = ”, $expire = 0)
  • wp_cache_close()
  • wp_cache_delete($id, $flag = ”)
  • wp_cache_delete($id, $flag = ”)
  • wp_cache_get($id, $flag = ”)
  • wp_cache_init()
  • wp_cache_replace($key, $data, $flag = ”, $expire = 0)
  • wp_cache_set($key, $data, $flag = ”, $expire = 0)

Back to full list of global variables.

Technorati tags:

Discussion [Participate or Link]

  1. Abhijit Nadgouda @ iface » Wordpress Global Variables said:

    [...] $wp_object_cache [...]

  2. Abhijit Nadgouda’s List of WordPress Global Variables « Lorelle on WordPress said:

    [...] Variables: wp_filter, richedit, page_cache, pagenow, wp_version, table_prefix,wp,admin_page_hooks, wp_object_cache, allowedposttags, allowedtags, and [...]

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.