mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user