Make WordPress Core

Ticket #49046: 49046.patch

File 49046.patch, 1.8 KB (added by jfarthing84, 5 years ago)
  • src/wp-includes/user.php

     
    28742874                $content = str_replace( '###SITENAME###', $sitename, $content );
    28752875                $content = str_replace( '###SITEURL###', home_url(), $content );
    28762876
    2877                 /* translators: New email address notification email subject. %s: Site title. */
    2878                 wp_mail( $_POST['email'], sprintf( __( '[%s] Email Change Request' ), $sitename ), $content );
     2877                $new_user_email_notification = array(
     2878                        'to' => $_POST['email'],
     2879                        /* translators: New email address notification email subject. %s: Site title. */
     2880                        'subject' => __( '[%s] Email Change Request' ),
     2881                        'message' => $content,
     2882                        'headers' => '',
     2883                );
    28792884
     2885                /**
     2886                 * Filters the contents of the new user email notification sent to the user upon email change.
     2887                 *
     2888                 * @since unknown
     2889                 *
     2890                 * @param array   $new_user_email_notification {
     2891                 *     Used to build wp_mail().
     2892                 *
     2893                 *     @type string $to         The intended recipient - New user email address.
     2894                 *     @type string $subject    The subject of the email.
     2895                 *     @type string $message    The body of the email.
     2896                 *     @type string $headers    The headers of the email.
     2897                 * }
     2898                 * @param WP_User $current_user User object for new user.
     2899                 * @param string  $sitename     The site title.
     2900                 */
     2901                $new_user_email_notification = apply_filters( 'new_user_email_notification', $new_user_email_notification, $current_user, $sitename );
     2902
     2903                wp_mail(
     2904                        $new_user_email_notification['to'],
     2905                        wp_specialchars_decode( sprintf( $new_user_email_notification['subject'], $sitename ) ),
     2906                        $new_user_email_notification['message'],
     2907                        $new_user_email_notification['headers']
     2908                );
     2909
    28802910                $_POST['email'] = $current_user->user_email;
    28812911        }
    28822912}