Make WordPress Core

Ticket #27317: admin-includes-user.php.patch

File admin-includes-user.php.patch, 520 bytes (added by crazycoolcam, 11 years ago)

With the above patch, creating a user via the dashboard generates a blank email if the user is blocked. This patch adds the appropriate test to stop the email if it's returning an error.

  • user.php

     
    176176                $user_id = wp_update_user( $user );
    177177        } else {
    178178                $user_id = wp_insert_user( $user );
    179                 wp_new_user_notification( $user_id, isset( $_POST['send_password'] ) ? wp_unslash( $pass1 ) : '' );
     179                if (!is_wp_error($user_id))
     180                        wp_new_user_notification( $user_id, isset( $_POST['send_password'] ) ? wp_unslash( $pass1 ) : '' );
    180181        }
    181182        return $user_id;
    182183}