wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups(). fixes #6740
git-svn-id: https://develop.svn.wordpress.org/trunk@7986 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
66b9c9ea6d
commit
66bb3c870e
@ -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.
|
||||
*
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user