WordPress.org

Make WordPress Core

Ticket #44314: 44314.3.diff

File 44314.3.diff, 4.5 KB (added by garrett-eclipse, 6 months ago)

Updated patch for deprecating the user_confirmed_action_email_content for erasure fulfillment emails

  • src/wp-includes/user.php

     
    30613061         * ###MANAGE_URL###  The URL to manage requests.
    30623062         * ###SITEURL###     The URL to the site.
    30633063         *
     3064         * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3065         *
    30643066         * @since 4.9.6
    30653067         *
    30663068         * @param string $email_text Text in the email.
     
    31973199
    31983200        if ( empty( $email_data['privacy_policy_url'] ) ) {
    31993201                /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
    3200                 $email_text = __(
     3202                $content = __(
    32013203                        'Howdy,
    32023204
    32033205Your request to erase your personal data on ###SITENAME### has been completed.
     
    32103212                );
    32113213        } else {
    32123214                /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */
    3213                 $email_text = __(
     3215                $content = __(
    32143216                        'Howdy,
    32153217
    32163218Your request to erase your personal data on ###SITENAME### has been completed.
     
    32333235         *
    32343236         * The following strings have a special meaning and will get replaced dynamically:
    32353237         *
     3238         * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3239         *
    32363240         * ###SITENAME###           The name of the site.
    32373241         * ###PRIVACY_POLICY_URL### Privacy policy page URL.
    32383242         * ###SITEURL###            The URL to the site.
    32393243         *
    32403244         * @since 4.9.6
     3245     * @deprecated 5.3.0 Use {@see 'user_erasure_fulfillment_email_content'} filter instead.
     3246     * @ignore This duplicate is deprecated and ignored to avoid documentation issues.
    32413247         *
    3242          * @param string $email_text Text in the email.
     3248         * @param string $content The email content.
    32433249         * @param array  $email_data {
    32443250         *     Data relating to the account action email.
    32453251         *
     
    32523258         *     @type string          $siteurl            The site URL sending the mail.
    32533259         * }
    32543260         */
    3255         $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
     3261        $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.3.0', 'user_erasure_fulfillment_email_content' );
    32563262
     3263        /**
     3264         * Filters the body of the data erasure fulfillment notification.
     3265         *
     3266         * The email is sent to a user when a their data erasure request is fulfilled
     3267         * by an administrator.
     3268         *
     3269         * The following strings have a special meaning and will get replaced dynamically:
     3270         *
     3271         * ###SITENAME###           The name of the site.
     3272         * ###PRIVACY_POLICY_URL### Privacy policy page URL.
     3273         * ###SITEURL###            The URL to the site.
     3274         *
     3275         * @since 5.3.0
     3276         *
     3277         * @param string $content The email content.
     3278         * @param array  $email_data {
     3279         *     Data relating to the account action email.
     3280         *
     3281         *     @type WP_User_Request $request            User request object.
     3282         *     @type string          $message_recipient  The address that the email will be sent to. Defaults
     3283         *                                               to the value of `$request->email`, but can be changed
     3284         *                                               by the `user_erasure_fulfillment_email_to` filter.
     3285         *     @type string          $privacy_policy_url Privacy policy URL.
     3286         *     @type string          $sitename           The site name sending the mail.
     3287         *     @type string          $siteurl            The site URL sending the mail.
     3288         * }
     3289         */
     3290        $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data );
     3291
    32573292        $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
    32583293        $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
    32593294        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
  • tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php

     
    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();