WordPress.org

Make WordPress Core

Ticket #11297: 11297_wp_new_user_notif-context.patch

File 11297_wp_new_user_notif-context.patch, 1.5 KB (added by nacin, 8 years ago)
  • wp-admin/includes/user.php

     
    181181                $user_id = wp_update_user( get_object_vars( $user ) );
    182182        } else {
    183183                $user_id = wp_insert_user( get_object_vars( $user ) );
    184                 wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
     184                wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '', 'admin' );
    185185        }
    186186        return $user_id;
    187187}
  • wp-includes/pluggable.php

     
    11431143 *
    11441144 * @param int $user_id User ID
    11451145 * @param string $plaintext_pass Optional. The user's plaintext password
     1146 * @param string $context Optional. Context in which function is called
    11461147 */
    1147 function wp_new_user_notification($user_id, $plaintext_pass = '') {
     1148function wp_new_user_notification($user_id, $plaintext_pass = '', $context = '') {
    11481149        $user = new WP_User($user_id);
    11491150
    11501151        $user_login = stripslashes($user->user_login);
  • wp-login.php

     
    270270                return $errors;
    271271        }
    272272
    273         wp_new_user_notification($user_id, $user_pass);
     273        wp_new_user_notification( $user_id, $user_pass, 'register' );
    274274
    275275        return $user_id;
    276276}