From ad7b2949ba246cdc1e437cbddf652d3a431d2f00 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 22 Aug 2019 01:53:55 +0000 Subject: [PATCH] Users: Adjust [45708] to make sure `wp_update_user()` does not issue a `WP_Error` if a single site was previously set up as Multisite and there's still a `spam` field in the user table. Add a unit test. Props azaozz, SergeyBiryukov. Fixes #45747. Built from https://develop.svn.wordpress.org/trunk@45874 git-svn-id: http://core.svn.wordpress.org/trunk@45685 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index f43f5e9a94..069e1c9ee7 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1665,7 +1665,7 @@ function wp_insert_user( $userdata ) { $user_activation_key = empty( $userdata['user_activation_key'] ) ? '' : $userdata['user_activation_key']; - if ( isset( $userdata['spam'] ) && ! is_multisite() ) { + if ( ! empty( $userdata['spam'] ) && ! is_multisite() ) { return new WP_Error( 'no_spam', __( 'Sorry, marking a user as spam is only supported on Multisite.' ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 01612d255e..61d7c84a63 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45873'; +$wp_version = '5.3-alpha-45874'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.