Make WordPress Core


Ignore:
Timestamp:
08/17/2015 02:24:43 PM (10 years ago)
Author:
obenland
Message:

Passwords: Restore second parameter for wp_new_user_notification().

After [33023] users would always be notified, this restores previous behavior.

Props markjaquith, ocean90.
Fixes #33358.

File:
1 edited

Legend:

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

    r33246 r33620  
    16891689 *
    16901690 * @since 2.0.0
    1691  *
    1692  * @param int    $user_id        User ID.
    1693  */
    1694 function wp_new_user_notification($user_id) {
     1691 * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
     1692 *
     1693 * @param int    $user_id User ID.
     1694 * @param string $notify  Whether admin and user should be notified ('both') or
     1695 *                        only the admin ('admin' or empty).
     1696 */
     1697function wp_new_user_notification( $user_id, $notify = '' ) {
    16951698    global $wpdb;
    16961699    $user = get_userdata( $user_id );
     
    17061709    @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
    17071710
     1711    if ( 'admin' === $notify || empty( $notify ) ) {
     1712        return;
     1713    }
     1714
    17081715    // Generate something random for a password reset key.
    17091716    $key = wp_generate_password( 20, false );
    17101717
     1718    /** This action is documented in wp-login.php */
    17111719    do_action( 'retrieve_password_key', $user->user_login, $key );
    17121720
     
    17261734
    17271735    wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
    1728 
    17291736}
    17301737endif;
Note: See TracChangeset for help on using the changeset viewer.