Make WordPress Core

Changeset 39932


Ignore:
Timestamp:
01/20/2017 05:32:13 PM (10 years ago)
Author:
flixos90
Message:

Multisite: Do not check for is_super_admin() when trying to set user settings.

The checks were introduced in [22256] to prevent user settings to be set for super admins that were not a member of the current site. However the latter should apply to any kind of user, so the is_super_admin() check is redundant. Furthermore, removing these checks is necessary for the ongoing effort to get rid of is_super_admin() checks in general.

Props chandrapatel for initial patch.
Fixes #39199. See #37616.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r39326 r39932  
    488488                $user_id = get_current_user_id();
    489489                // Don't create an option if this is a super admin who does not belong to this site.
    490                 if ( ! ( is_super_admin( $user_id ) && ! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) )
     490                if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) )
    491491                        update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
    492492        }
  • trunk/src/wp-includes/option.php

    r39600 r39932  
    809809        }
    810810
    811         if ( is_super_admin() && ! is_user_member_of_blog() ) {
     811        if ( ! is_user_member_of_blog() ) {
    812812                return;
    813813        }
     
    973973        }
    974974
    975         if ( is_super_admin() && ! is_user_member_of_blog() ) {
     975        if ( ! is_user_member_of_blog() ) {
    976976                return;
    977977        }
Note: See TracChangeset for help on using the changeset viewer.