Introduce WP_User::for_blog() and current_user_can_for_blog() to avoid calls to WP_User::_init_caps(). fixes #11781

git-svn-id: https://develop.svn.wordpress.org/trunk@12796 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-22 17:27:28 +00:00
parent ffd8c38ae1
commit 57577592b6
3 changed files with 51 additions and 4 deletions
+2 -2
View File
@@ -306,7 +306,7 @@ function switch_to_blog( $new_blog ) {
}
if ( is_object( $current_user ) )
$current_user->_init_caps();
$current_user->for_blog( $blog_id );
if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) )
$global_groups = $wp_object_cache->global_groups;
@@ -359,7 +359,7 @@ function restore_current_blog() {
}
if ( is_object( $current_user ) )
$current_user->_init_caps();
$current_user->for_blog( $blog_id );
if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) )
$global_groups = $wp_object_cache->global_groups;