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.

Built from https://develop.svn.wordpress.org/trunk@39932


git-svn-id: http://core.svn.wordpress.org/trunk@39869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2017-01-20 17:33:41 +00:00
parent e9056c039d
commit dd23a8f48c
3 changed files with 4 additions and 4 deletions

View File

@ -487,7 +487,7 @@ function wp_dashboard_quick_press( $error_msg = false ) {
$post = get_default_post_to_edit( 'post' , true);
$user_id = get_current_user_id();
// Don't create an option if this is a super admin who does not belong to this site.
if ( ! ( is_super_admin( $user_id ) && ! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) ) )
if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ) ) )
update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
}

View File

@ -808,7 +808,7 @@ function wp_user_settings() {
return;
}
if ( is_super_admin() && ! is_user_member_of_blog() ) {
if ( ! is_user_member_of_blog() ) {
return;
}
@ -972,7 +972,7 @@ function wp_set_all_user_settings( $user_settings ) {
return false;
}
if ( is_super_admin() && ! is_user_member_of_blog() ) {
if ( ! is_user_member_of_blog() ) {
return;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39931';
$wp_version = '4.8-alpha-39932';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.