Make WordPress Core

Ticket #42132: 42132.3.patch

File 42132.3.patch, 2.7 KB (added by anand.au14, 5 years ago)

Added refreshed patch

  • src/wp-admin/user-new.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    5959        }
    6060
    6161        // Adding an existing user to this blog
    62         $new_user_email = $user_details->user_email;
     62        $new_user_email['to'] = $user_details->user_email;
    6363        $redirect       = 'user-new.php';
    6464        $username       = $user_details->user_login;
    6565        $user_id        = $user_details->ID;
     
    116116                        $message = __(
    117117                                'Hi,
    118118
    119 You\'ve been invited to join \'%1$s\' at
    120 %2$s with the role of %3$s.
    121 
    122 Please click the following link to confirm the invite:
    123 %4$s'
     119                You\'ve been invited to join \'%1$s\' at
     120                %2$s with the role of %3$s.
     121               
     122                Please click the following link to confirm the invite:
     123                %4$s'
    124124                        );
    125125
    126                         wp_mail(
    127                                 $new_user_email,
    128                                 sprintf(
    129                                         /* translators: Joining confirmation notification email subject. %s: Site title. */
    130                                         __( '[%s] Joining Confirmation' ),
    131                                         wp_specialchars_decode( get_option( 'blogname' ) )
    132                                 ),
    133                                 sprintf(
    134                                         $message,
    135                                         get_option( 'blogname' ),
    136                                         home_url(),
    137                                         wp_specialchars_decode( translate_user_role( $role['name'] ) ),
    138                                         home_url( "/newbloguser/$newuser_key/" )
    139                                 )
    140                         );
     126                        $new_user_email['message'] = $message;
     127                        $new_user_email['subject'] = sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) );
     128                $new_user_email['message'] = sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ), home_url( "/newbloguser/$newuser_key/" ) ) );
     129
     130                /**
     131             * Filters the contents of the email sent when a new user is added.
     132                         *
     133                         * @since
     134                         *
     135                         * @param array $new_user_email {
     136                         *            Used to build wp_mail().
     137                         *            @type string $to      The intended recipients. Add emails in a comma separated string.
     138                         *            @type string $subject The subject of the email.
     139                         *            @type string $message The content of the email.
     140                         *        }
     141                         * @param array $user_id     The invided user's ID
     142                         * @param array $role        The role of invited user.
     143             * @param string $newuser_key The key of the invitation.
     144                         *
     145                         */
     146
     147                 $new_user_email = apply_filters('new_user_emails',$new_user_email, $user_id, $role, $newuser_key);
     148
     149                 wp_mail( $new_user_email['to'], $new_user_email['subject'], $new_user_email['message'] );
    141150
    142151                        if ( $switched_locale ) {
    143152                                restore_previous_locale();