diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-09 17:28:14 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-09 17:28:14 +0000 |
commit | 957d3a2fa4285f17f120b1f295824002686ce930 (patch) | |
tree | 299b2c6b151ef914dd343a575f0ff2ab1f8ad052 /wp-includes/wpmu-functions.php | |
parent | b5b8f7fba1f7062c5b5f308dcf2f14d6f75efdda (diff) | |
download | wordpress-mu-957d3a2fa4285f17f120b1f295824002686ce930.tar.gz wordpress-mu-957d3a2fa4285f17f120b1f295824002686ce930.tar.xz wordpress-mu-957d3a2fa4285f17f120b1f295824002686ce930.zip |
Clean up switching code. Don't switch to current blog.
If using an object cache make sure it knows about MU groups
Added "counts" group for 2.5.1 compatibility
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1281 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/wpmu-functions.php')
-rw-r--r-- | wp-includes/wpmu-functions.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index c95c77d..bc5764f 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -322,10 +322,13 @@ function update_blog_option( $id, $key, $value, $refresh = true ) { } function switch_to_blog( $new_blog ) { - global $tmpoldblogdetails, $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user; + global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache; if ( empty($new_blog) ) - $new_blog = $blog_id; + return; + + if ( $blog_id == $new_blog ) + return; if ( empty($switched_stack) ) $switched_stack = array(); @@ -350,7 +353,7 @@ function switch_to_blog( $new_blog ) { } function restore_current_blog() { - global $table_prefix, $tmpoldblogdetails, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $current_user; + global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache; if ( !$switched ) return; @@ -1858,4 +1861,9 @@ function promote_if_site_admin(&$user) { $user->{$cap_key} = array( 'administrator' => '1' ); } +if( is_object( $wp_object_cache ) ) { + $wp_object_cache->global_groups = array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss'); + $wp_object_cache->non_persistent_groups = array('comment', 'counts'); +} + ?> |