Make WordPress Core

Ticket #43968: 43968-with-filter.diff

File 43968-with-filter.diff, 1.8 KB (added by desrosj, 7 years ago)

Add request type to email subject (with filter)

  • src/wp-includes/user.php

     
    31413141        $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
    31423142        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    31433143
     3144        $subject = sprintf(
     3145                /**
     3146                 * Filters the subject of the email sent when an account action is attempted.
     3147                 *
     3148                 * @since 4.9.6
     3149                 *
     3150                 * @param string $subject    The email subject.
     3151                 * @param array  $email_data {
     3152                 *     Data relating to the account action email.
     3153                 *
     3154                 *     @type WP_User_Request $request User request object.
     3155                 *     @type string          $email       The email address this is being sent to.
     3156                 *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3157                 *     @type string          $confirm_url The link to click on to confirm the account action.
     3158                 *     @type string          $sitename    The site name sending the mail.
     3159                 *     @type string          $siteurl     The site URL sending the mail.
     3160                 * }
     3161                 */
     3162                apply_filters(
     3163                        'user_request_action_email_subject',
     3164                        /* translators: Privacy data request subject. 1: Site name, 2: Name of the action */
     3165                        __( '[%1$s] Confirm Action: %2$s' ),
     3166                        $email_data
     3167                ),
     3168                wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
     3169                $email_data['description']
     3170        );
     3171
    31443172        /* translators: %s Site name. */
    3145         return wp_mail( $email_data['email'], sprintf( __( '[%s] Confirm Action' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
     3173        return wp_mail( $email_data['email'], $subject, $content );
    31463174}
    31473175
    31483176/**