WordPress.org

Make WordPress Core

Ticket #44314: 44314.4.diff

File 44314.4.diff, 4.6 KB (added by audrasjb, 16 months ago)

Patch refresh for WP 5.5

  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index a1e88f2e5a..55188943b1 100644
    a b All at ###SITENAME### 
    32603260         * ###MANAGE_URL###  The URL to manage requests.
    32613261         * ###SITEURL###     The URL to the site.
    32623262         *
     3263         * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3264         *
    32633265         * @since 4.9.6
    32643266         *
    32653267         * @param string $email_text Text in the email.
    function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) { 
    34213423
    34223424        if ( empty( $email_data['privacy_policy_url'] ) ) {
    34233425                /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
    3424                 $email_text = __(
     3426                $content = __(
    34253427                        'Howdy,
    34263428
    34273429Your request to erase your personal data on ###SITENAME### has been completed.
    All at ###SITENAME### 
    34343436                );
    34353437        } else {
    34363438                /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */
    3437                 $email_text = __(
     3439                $content = __(
    34383440                        'Howdy,
    34393441
    34403442Your request to erase your personal data on ###SITENAME### has been completed.
    All at ###SITENAME### 
    34573459         *
    34583460         * The following strings have a special meaning and will get replaced dynamically:
    34593461         *
     3462         * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3463         *
    34603464         * ###SITENAME###           The name of the site.
    34613465         * ###PRIVACY_POLICY_URL### Privacy policy page URL.
    34623466         * ###SITEURL###            The URL to the site.
    34633467         *
    34643468         * @since 4.9.6
    34653469         *
    3466          * @param string $email_text Text in the email.
     3470         * @deprecated 5.5.0 Use {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3471         * @ignore This duplicate is deprecated and ignored to avoid documentation issues.
     3472         *
     3473         * @param string $content The email content.
    34673474         * @param array  $email_data {
    34683475         *     Data relating to the account action email.
    34693476         *
    All at ###SITENAME### 
    34763483         *     @type string          $siteurl            The site URL sending the mail.
    34773484         * }
    34783485         */
    3479         $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
     3486        $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.5.0', 'user_erasure_fulfillment_email_content' );
     3487
     3488        /**
     3489         * Filters the body of the data erasure fulfillment notification.
     3490         *
     3491         * The email is sent to a user when a their data erasure request is fulfilled
     3492         * by an administrator.
     3493         *
     3494         * The following strings have a special meaning and will get replaced dynamically:
     3495         *
     3496         * ###SITENAME###           The name of the site.
     3497         * ###PRIVACY_POLICY_URL### Privacy policy page URL.
     3498         * ###SITEURL###            The URL to the site.
     3499         *
     3500         * @since 5.5.0
     3501         *
     3502         * @param string $content The email content.
     3503         * @param array  $email_data {
     3504         *     Data relating to the account action email.
     3505         *
     3506         *     @type WP_User_Request $request            User request object.
     3507         *     @type string          $message_recipient  The address that the email will be sent to. Defaults
     3508         *                                               to the value of `$request->email`, but can be changed
     3509         *                                               by the `user_erasure_fulfillment_email_to` filter.
     3510         *     @type string          $privacy_policy_url Privacy policy URL.
     3511         *     @type string          $sitename           The site name sending the mail.
     3512         *     @type string          $siteurl            The site URL sending the mail.
     3513         * }
     3514         */
     3515        $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data );
    34803516
    34813517        $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
    34823518        $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
  • tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php

    diff --git a/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php b/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
    index 5a2b1c62a4..352326c3d8 100644
    a b class Tests_Privacy_WpPrivacySendErasureFulfillmentNotification extends WP_UnitT 
    236236         * @ticket 44234
    237237         */
    238238        public function test_email_body_text_should_be_filterable() {
    239                 add_filter( 'user_confirmed_action_email_content', array( $this, 'filter_email_body_text' ) );
     239                add_filter( 'user_erasure_fulfillment_email_content', array( $this, 'filter_email_body_text' ) );
    240240                _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
    241241
    242242                $mailer = tests_retrieve_phpmailer_instance();