From 83cd8e87a83ecb4412d933434d247cae40e63c4c Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Thu, 27 Feb 2014 13:34:18 -0800 Subject: [PATCH] Match function order to Core's template and add a function that Core has but we're missing. --- object-cache.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/object-cache.php b/object-cache.php index ea2b029..f61e9db 100644 --- a/object-cache.php +++ b/object-cache.php @@ -108,6 +108,17 @@ function wp_cache_incr( $key, $offset = 1, $group = '' ) { return $wp_object_cache->increment( $key, $offset, $group ); } +/** + * Sets up Object Cache Global and assigns it. + * + * @global WP_Object_Cache $wp_object_cache WordPress Object Cache + * @return void + */ +function wp_cache_init() { + global $wp_object_cache; + $wp_object_cache = new WP_Object_Cache(); +} + /** * Replaces a value in cache. * @@ -146,15 +157,19 @@ function wp_cache_set( $key, $value, $group = '', $expiration = 0 ) { } /** - * Sets up Object Cache Global and assigns it. + * Switch the interal blog id. * - * @global WP_Object_Cache $wp_object_cache WordPress Object Cache - * @return void + * This changes the blog id used to create keys in blog specific groups. + * + * @since 3.5.0 + * + * @param int $blog_id Blog ID */ -function wp_cache_init() { - global $wp_object_cache; - $wp_object_cache = new WP_Object_Cache(); -} +// function wp_cache_switch_to_blog( $blog_id ) { +// global $wp_object_cache; + +// return $wp_object_cache->switch_to_blog( $blog_id ); +// } /** * Adds a group or set of groups to the list of Redis groups. -- GitLab