mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user