WordPress.org

Make WordPress Core

Ticket #44501: 44501.diff

File 44501.diff, 6.6 KB (added by xkon, 10 months ago)
  • src/wp-admin/includes/privacy-tools.php

    diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php
    index efe46cce32..da05163a33 100644
    a b All at ###SITENAME### 
    595595        $content = str_replace( '###SITENAME###', $site_name, $content );
    596596        $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content );
    597597
    598         $mail_success = wp_mail( $request_email, $subject, $content );
     598        $headers = '';
     599
     600        /**
     601         * Filters the headers of the email sent with a personal data export file.
     602         *
     603         * @since 5.4.0
     604         *
     605         * @param string|array $headers    The email headers.
     606         * @param string       $subject    The email subject.
     607         * @param string       $content    The email content.
     608         * @param int          $request_id The request ID.
     609         * @param array        $email_data {
     610         *     Data relating to the account action email.
     611         *
     612         *     @type WP_User_Request $request           User request object.
     613         *     @type int             $expiration        The time in seconds until the export file expires.
     614         *     @type string          $expiration_date   The localized date and time when the export file expires.
     615         *     @type string          $message_recipient The address that the email will be sent to. Defaults
     616         *                                              to the value of `$request->email`, but can be changed
     617         *                                              by the `wp_privacy_personal_data_email_to` filter.
     618         *     @type string          $export_file_url   The export file URL.
     619         *     @type string          $sitename          The site name sending the mail.
     620         *     @type string          $siteurl           The site URL sending the mail.
     621         * }
     622         */
     623        $headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data );
     624
     625        $mail_success = wp_mail( $request_email, $subject, $content, $headers );
    599626
    600627        if ( $switched_locale ) {
    601628                restore_previous_locale();
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index a1478679f6..f5c611ebec 100644
    a b All at ###SITENAME### 
    31783178         */
    31793179        $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );
    31803180
    3181         $email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
     3181        $headers = '';
     3182
     3183        /**
     3184         * Filters the headers of the user request confirmation email.
     3185         *
     3186         * @since 5.4.0
     3187         *
     3188         * @param string|array $headers    The email headers.
     3189         * @param string       $subject    The email subject.
     3190         * @param string       $email_text The email content.
     3191         * @param int          $request_id The request ID.
     3192         * @param array        $email_data {
     3193         *     Data relating to the account action email.
     3194         *
     3195         *     @type WP_User_Request $request     User request object.
     3196         *     @type string          $email       The email address this is being sent to.
     3197         *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3198         *     @type string          $confirm_url The link to click on to confirm the account action.
     3199         *     @type string          $sitename    The site name sending the mail.
     3200         *     @type string          $siteurl     The site URL sending the mail.
     3201         * }
     3202         */
     3203        $headers = apply_filters( 'user_request_confirmed_email_headers', $headers, $subject, $content, $request_id, $email_data );
     3204
     3205        $email_sent = wp_mail( $email_data['admin_email'], $subject, $content, $headers );
    31823206
    31833207        if ( $email_sent ) {
    31843208                update_post_meta( $request_id, '_wp_admin_notified', true );
    All at ###SITENAME### 
    33243348        $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
    33253349        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    33263350
    3327         $email_sent = wp_mail( $user_email, $subject, $content );
     3351        $headers = '';
     3352
     3353        /**
     3354         * Filters the headers of the user request confirmation email.
     3355         *
     3356         * @since 5.4.0
     3357         *
     3358         * @param string|array $headers    The email headers.
     3359         * @param string       $subject    The email subject.
     3360         * @param string       $content    The email content.
     3361         * @param int          $request_id The request ID.
     3362         * @param array        $email_data {
     3363         *     Data relating to the account action email.
     3364         *
     3365         *     @type WP_User_Request $request     User request object.
     3366         *     @type string          $email       The email address this is being sent to.
     3367         *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3368         *     @type string          $confirm_url The link to click on to confirm the account action.
     3369         *     @type string          $sitename    The site name sending the mail.
     3370         *     @type string          $siteurl     The site URL sending the mail.
     3371         * }
     3372         */
     3373        $headers = apply_filters( 'user_erasure_complete_email_headers', $headers, $subject, $content, $request_id, $email_data );
     3374
     3375        $email_sent = wp_mail( $user_email, $subject, $content, $headers );
    33283376
    33293377        if ( $switched_locale ) {
    33303378                restore_previous_locale();
    All at ###SITENAME### 
    35863634         */
    35873635        $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );
    35883636
    3589         $email_sent = wp_mail( $email_data['email'], $subject, $content );
     3637        $headers = '';
     3638
     3639        /**
     3640         * Filters the headers of the email sent when an account action is attempted.
     3641         *
     3642         * @since 5.4.0
     3643         *
     3644         * @param string|array $headers    The email headers.
     3645         * @param string       $subject    The email subject.
     3646         * @param string       $email_text The email content.
     3647         * @param int          $request_id The request ID.
     3648         * @param array        $email_data {
     3649         *     Data relating to the account action email.
     3650         *
     3651         *     @type WP_User_Request $request     User request object.
     3652         *     @type string          $email       The email address this is being sent to.
     3653         *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3654         *     @type string          $confirm_url The link to click on to confirm the account action.
     3655         *     @type string          $sitename    The site name sending the mail.
     3656         *     @type string          $siteurl     The site URL sending the mail.
     3657         * }
     3658         */
     3659        $headers = apply_filters( 'user_request_action_email_headers', $headers, $subject, $content, $request_id, $email_data );
     3660
     3661        $email_sent = wp_mail( $email_data['email'], $subject, $content, $headers );
    35903662
    35913663        if ( $switched_locale ) {
    35923664                restore_previous_locale();