WordPress.org

Make WordPress Core

Ticket #36009: 36009.diff

File 36009.diff, 1.8 KB (added by akibjorklund, 5 years ago)
  • src/wp-includes/pluggable.php

     
    16981698 * @param int    $user_id    User ID.
    16991699 * @param null   $deprecated Not used (argument deprecated).
    17001700 * @param string $notify     Optional. Type of notification that should happen. Accepts 'admin' or an empty
    1701  *                           string (admin only), or 'both' (admin and user). Default empty.
     1701 *                           string (admin only), 'user', or 'both' (admin and user). Default empty.
    17021702 */
    17031703function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
    17041704        if ( $deprecated !== null ) {
     
    17121712        // we want to reverse this for the plain text arena of emails.
    17131713        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    17141714
    1715         $message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
    1716         $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
    1717         $message .= sprintf(__('Email: %s'), $user->user_email) . "\r\n";
     1715        if ( 'user' !== $notify ) {
     1716                $message  = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
     1717                $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
     1718                $message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n";
    17181719
    1719         @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
     1720                @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message );
     1721        }
    17201722
    17211723        // `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notifcation.
    17221724        if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {