WordPress.org

Make WordPress Core

Ticket #44721: 44721-2.diff

File 44721-2.diff, 878 bytes (added by birgire, 6 months ago)
  • src/wp-includes/user.php

    diff --git src/wp-includes/user.php src/wp-includes/user.php
    index 064f514..edb34bf 100644
    function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) { 
    31433143                return;
    31443144        }
    31453145
     3146        // Localize message content for user; fallback to site default for visitors.
     3147        if ( ! empty( $request->user_id ) ) {
     3148                $locale = get_user_locale( $request->user_id );
     3149        } else {
     3150                $locale = get_locale();
     3151        }
     3152
     3153        $switched_locale = switch_to_locale( $locale );
     3154
    31463155        /**
    31473156         * Filters the recipient of the data erasure fulfillment notification.
    31483157         *
    All at ###SITENAME### 
    32533262
    32543263        $email_sent = wp_mail( $user_email, $subject, $content );
    32553264
     3265        if ( $switched_locale ) {
     3266                restore_previous_locale();
     3267        }
     3268
    32563269        if ( $email_sent ) {
    32573270                update_post_meta( $request_id, '_wp_user_notified', true );
    32583271        }