From 2b145d5066c4b2f7757c888789c7fd44acf37746 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Thu, 7 Jul 2016 17:47:54 +0000 Subject: [PATCH] Multisite: Correct logic used to display an Edit User link after adding a user. Previously, if a user was added with the checkbox for no confirmation selected and an error was then encountered in `wpmu_activate_signup()`, a fatal error would trigger because `$new_user` was a `WP_Error` object rather than a user. Fixes #37223. git-svn-id: https://develop.svn.wordpress.org/trunk@38007 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/user-new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/user-new.php b/src/wp-admin/user-new.php index 7b9a9eac51..14a6a63411 100644 --- a/src/wp-admin/user-new.php +++ b/src/wp-admin/user-new.php @@ -148,7 +148,7 @@ Please click the following link to confirm the invite: if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) { $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); $new_user = wpmu_activate_signup( $key ); - if ( ! is_wp_error( $new_user ) ) { + if ( is_wp_error( $new_user ) ) { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' ); } else { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $new_user['user_id'] ), 'user-new.php' );