diff options
Diffstat (limited to 'wp-includes/wpmu-functions.php')
-rw-r--r-- | wp-includes/wpmu-functions.php | 6 |
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; |