WordPress.org

Make WordPress Core

Ticket #28530: 28530.patch

File 28530.patch, 2.3 KB (added by jokr, 7 years ago)

modify wp_new_user_notification so that it redirects to wpmu_welcome_user_notification if multisite is enabled

  • wp-includes/pluggable.php

     
    16051605 * @param string $plaintext_pass Optional. The user's plaintext password. Default empty.
    16061606 */
    16071607function wp_new_user_notification($user_id, $plaintext_pass = '') {
    1608         $user = get_userdata( $user_id );
     1608        if( is_multisite() ) {
     1609                wpmu_welcome_user_notification( $user_id, $plaintext_pass );
     1610        } else {
     1611                $user = get_userdata( $user_id );
    16091612
    1610         // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    1611         // we want to reverse this for the plain text arena of emails.
    1612         $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     1613                // The blogname option is escaped with esc_html on the way into the database in sanitize_option
     1614                // we want to reverse this for the plain text arena of emails.
     1615                $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    16131616
    1614         $message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
    1615         $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
    1616         $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
     1617                $message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
     1618                $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
     1619                $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
    16171620
    1618         @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
     1621                @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
    16191622
    1620         if ( empty($plaintext_pass) )
    1621                 return;
     1623                if ( empty($plaintext_pass) )
     1624                        return;
    16221625
    1623         $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    1624         $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    1625         $message .= wp_login_url() . "\r\n";
     1626                $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
     1627                $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
     1628                $message .= wp_login_url() . "\r\n";
    16261629
    1627         wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
    1628 
     1630                wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
     1631        }
    16291632}
    16301633endif;
    16311634