WordPress.org

Make WordPress Core

Ticket #49564: 49564.diff

File 49564.diff, 2.0 KB (added by donmhico, 18 months ago)
  • src/wp-includes/ms-functions.php

    diff --git src/wp-includes/ms-functions.php src/wp-includes/ms-functions.php
    index 688b758263..f2e38aa1b8 100644
    function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) 
    17301730                $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    17311731        }
    17321732
    1733         $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    1734         $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
    1735         $message         = $welcome_email;
     1733        $from_name         = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
     1734        $message_headers   = array();
     1735        $message_headers[] = "From: \"{$from_name}\" <{$admin_email}>\n";
     1736        $message_headers[] = 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
     1737        $message           = $welcome_email;
    17361738
    17371739        if ( empty( $current_network->site_name ) ) {
    17381740                $current_network->site_name = 'WordPress';
    function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) 
    17501752         */
    17511753        $subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) );
    17521754
     1755        /**
     1756         * Filters the headers of the welcome email after user activation.
     1757         *
     1758         * @since 5.5.0
     1759         *
     1760         * @param array   $message_headers  The email headers.
     1761         * @param string  $subject          The email subject.
     1762         * @param string  $message          The email content.
     1763         * @param WP_User $user             The user to be notified.
     1764         * @param array   $current_network  The current network.
     1765         */
     1766        $message_headers = apply_filters( 'update_welcome_user_headers', $message_headers, $subject, $message, $user, $current_network );
     1767
    17531768        wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    17541769
    17551770        if ( $switched_locale ) {