wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups(). fixes #6740

git-svn-id: http://svn.automattic.com/wordpress/trunk@7986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-22 17:28:54 +00:00
parent 53ecaddb5f
commit 58e47dcb4a
2 changed files with 28 additions and 9 deletions

View File

@ -137,6 +137,30 @@ function wp_cache_set($key, $data, $flag = '', $expire = 0) {
return $wp_object_cache->set($key, $data, $flag, $expire);
}
/**
* wp_cache_add_global_groups() - Adds a group or set of groups to the list of global groups
*
* @since 2.6
*
* @param string|array $groups A group or an array of groups to add
*/
function wp_cache_add_global_groups( $groups ) {
// Default cache doesn't persist so nothing to do here.
return;
}
/**
* wp_cache_add_non_persistent_groups() - Adds a group or set of groups to the list of non-persistent groups
*
* @since 2.6
*
* @param string|array $groups A group or an array of groups to add
*/
function wp_cache_add_non_persistent_groups( $groups ) {
// Default cache doesn't persist so nothing to do here.
return;
}
/**
* WordPress Object Cache
*
@ -173,15 +197,6 @@ class WP_Object_Cache {
*/
var $non_existant_objects = array ();
/**
* Object caches that are global
*
* @var array
* @access private
* @since 2.0
*/
var $global_groups = array ('users', 'userlogins', 'usermeta');
/**
* The amount of times the cache data was already stored in the cache.
*

View File

@ -219,6 +219,10 @@ else
require_once (ABSPATH . WPINC . '/cache.php');
wp_cache_init();
if ( function_exists('wp_cache_add_global_groups') ) {
wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta'));
wp_cache_add_non_persistent_groups(array( 'comment', 'counts' ));
}
require (ABSPATH . WPINC . '/plugin.php');
require (ABSPATH . WPINC . '/default-filters.php');