Don't create {$blog_id}_user-settings, {$blog_id}_user-settings-time, and {$blog_id}_dashboard_quick_press_last_post_id user options when a super admin visits a site they aren't a member of. Instead, rely solely on the wp-settings cookie.

fixes #22178


git-svn-id: https://develop.svn.wordpress.org/trunk@22256 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-10-17 18:58:09 +00:00
parent e033812490
commit 194e2775b8
2 changed files with 16 additions and 3 deletions
+10
View File
@@ -540,6 +540,11 @@ function wp_user_settings() {
if ( ! $user = wp_get_current_user() )
return;
if ( is_super_admin( $user->ID ) &&
! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user->ID ) ) )
)
return;
$settings = get_user_option( 'user-settings', $user->ID );
if ( isset( $_COOKIE['wp-settings-' . $user->ID] ) ) {
@@ -697,6 +702,11 @@ function wp_set_all_user_settings($all) {
if ( ! $user = wp_get_current_user() )
return false;
if ( is_super_admin( $user->ID ) &&
! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user->ID ) ) )
)
return;
$_updated_user_settings = $all;
$settings = '';
foreach ( $all as $k => $v ) {