WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/25/2015 10:37:35 PM (6 years ago)
Author:
ocean90
Message:

Users: Allow to create users without sending an email to the new user.

This adds a checkbox to wp-admin/user-new.php to prevent sending an email with the username and a password reset link to the new user. Restores the behavior of pre-4.3.

Fixes #33504.
Props tharsheblows, SergeyBiryukov, DrewAPicture, ocean90.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r35725 r35742  
    177177    } else {
    178178        $user_id = wp_insert_user( $user );
     179        $notify  = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';
     180
    179181        /**
    180182          * Fires after a new user has been created.
     
    182184          * @since 4.4.0
    183185          *
    184           * @param int $user_id ID of the newly created user.
     186          * @param int    $user_id ID of the newly created user.
     187          * @param string $notify  Type of notification that should happen. See {@see wp_send_new_user_notifications()}
     188          *                        for more information on possible values.
    185189          */
    186         do_action( 'edit_user_created_user', $user_id );
     190        do_action( 'edit_user_created_user', $user_id, $notify );
    187191    }
    188192    return $user_id;
Note: See TracChangeset for help on using the changeset viewer.