Make WordPress Core

Ticket #33358: 33358.5.diff

File 33358.5.diff, 3.8 KB (added by ocean90, 10 years ago)

Adds changelog entry to wp_new_user_notification()

  • src/wp-admin/includes/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 );
     179                wp_new_user_notification( $user_id, 'both' );
    180180        }
    181181        return $user_id;
    182182}
  • src/wp-admin/network/site-new.php

     
    7979                if ( false === $user_id )
    8080                        wp_die( __( 'There was an error creating the user.' ) );
    8181                else
    82                         wp_new_user_notification( $user_id, $password );
     82                        wp_new_user_notification( $user_id, 'both' );
    8383        }
    8484
    8585        $wpdb->hide_errors();
  • src/wp-admin/network/site-users.php

     
    7777                                if ( false === $user_id ) {
    7878                                        $update = 'err_new_dup';
    7979                                } else {
    80                                         wp_new_user_notification( $user_id, $password );
     80                                        wp_new_user_notification( $user_id, 'both' );
    8181                                        add_user_to_blog( $id, $user_id, $_POST['new_role'] );
    8282                                        $update = 'newuser';
    8383                                }
  • src/wp-admin/network/user-new.php

     
    5151                if ( ! $user_id ) {
    5252                        $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
    5353                } else {
    54                         wp_new_user_notification( $user_id, $password );
     54                        wp_new_user_notification( $user_id, 'both' );
    5555                        wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );
    5656                        exit;
    5757                }
  • src/wp-includes/pluggable.php

     
    16881688 * A new user registration notification is also sent to admin email.
    16891689 *
    16901690 * @since 2.0.0
     1691 * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
    16911692 *
    1692  * @param int    $user_id        User ID.
     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).
    16931696 */
    1694 function wp_new_user_notification($user_id) {
     1697function wp_new_user_notification( $user_id, $notify = '' ) {
    16951698        global $wpdb;
    16961699        $user = get_userdata( $user_id );
    16971700
     
    17051708
    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
    17131721        // Now insert the key, hashed, into the DB.
     
    17251733        $message .= wp_login_url() . "\r\n";
    17261734
    17271735        wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
    1728 
    17291736}
    17301737endif;
    17311738
  • src/wp-includes/user.php

     
    26192619
    26202620        update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
    26212621
    2622         wp_new_user_notification( $user_id );
     2622        wp_new_user_notification( $user_id, 'both' );
    26232623
    26242624        return $user_id;
    26252625}