summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-21 10:59:29 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-21 10:59:29 +0000
commite46b68482095f5e9d0f74ae6f639c5dbe505a727 (patch)
treeeab696bf5dd9e6c05d84c568e0ab67abb2a986e3 /wp-includes
parent1d5b32b4db909b7118911bbd8d86f463ff122087 (diff)
downloadwordpress-mu-e46b68482095f5e9d0f74ae6f639c5dbe505a727.tar.gz
wordpress-mu-e46b68482095f5e9d0f74ae6f639c5dbe505a727.tar.xz
wordpress-mu-e46b68482095f5e9d0f74ae6f639c5dbe505a727.zip
Backup the object cache when switching and restore it afterwards.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1387 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/wpmu-functions.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index 0001f5d..67fc456 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -360,6 +360,9 @@ function switch_to_blog( $new_blog ) {
if ( $blog_id == $new_blog )
return;
+ $wp_object_cache->switched_cache[ $blog_id ] = $wp_object_cache->cache;
+ unset( $wp_object_cache->cache );
+
$wpdb->set_blog_id($new_blog);
$table_prefix = $wpdb->prefix;
$prev_blog_id = $blog_id;
@@ -388,6 +391,9 @@ function restore_current_blog() {
if ( $blog_id == $blog )
return;
+ $wp_object_cache->cache = $wp_object_cache->switched_cache[ $blog ];
+ unset( $wp_object_cache->switched_cache[ $blog ] );
+
$wpdb->set_blog_id($blog);
$prev_blog_id = $blog_id;
$blog_id = $blog;