Ticket #44314: 44314.4.diff
File 44314.4.diff, 4.6 KB (added by , 5 years ago) |
---|
-
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### 3260 3260 * ###MANAGE_URL### The URL to manage requests. 3261 3261 * ###SITEURL### The URL to the site. 3262 3262 * 3263 * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3264 * 3263 3265 * @since 4.9.6 3264 3266 * 3265 3267 * @param string $email_text Text in the email. … … function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) { 3421 3423 3422 3424 if ( empty( $email_data['privacy_policy_url'] ) ) { 3423 3425 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3424 $ email_text = __(3426 $content = __( 3425 3427 'Howdy, 3426 3428 3427 3429 Your request to erase your personal data on ###SITENAME### has been completed. … … All at ###SITENAME### 3434 3436 ); 3435 3437 } else { 3436 3438 /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ 3437 $ email_text = __(3439 $content = __( 3438 3440 'Howdy, 3439 3441 3440 3442 Your request to erase your personal data on ###SITENAME### has been completed. … … All at ###SITENAME### 3457 3459 * 3458 3460 * The following strings have a special meaning and will get replaced dynamically: 3459 3461 * 3462 * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3463 * 3460 3464 * ###SITENAME### The name of the site. 3461 3465 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3462 3466 * ###SITEURL### The URL to the site. 3463 3467 * 3464 3468 * @since 4.9.6 3465 3469 * 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. 3467 3474 * @param array $email_data { 3468 3475 * Data relating to the account action email. 3469 3476 * … … All at ###SITENAME### 3476 3483 * @type string $siteurl The site URL sending the mail. 3477 3484 * } 3478 3485 */ 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 ); 3480 3516 3481 3517 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3482 3518 $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 236 236 * @ticket 44234 237 237 */ 238 238 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' ) ); 240 240 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 241 241 242 242 $mailer = tests_retrieve_phpmailer_instance();