Last active
December 29, 2015 08:09
-
-
Save jbrinley/7641703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Switch the interal blog id. | |
* | |
* 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_switch_to_blog( $blog_id ) { | |
global $wp_object_cache; | |
return $wp_object_cache->switch_to_blog( $blog_id ); | |
} | |
class WP_Object_Cache { | |
/* ... */ | |
function switch_to_blog( $blog_id ) { | |
global $table_prefix; | |
$blog_id = (int) $blog_id; | |
$this->blog_prefix = WP_MEMCACHED_KEY_SALT.':'; | |
$this->blog_prefix .= ( is_multisite() ? $blog_id : $table_prefix ) . ':'; | |
} | |
/* ... */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment