Ticket #44314: 44314.5.diff
File 44314.5.diff, 21.3 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/privacy-tools.php
628 628 629 629 /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */ 630 630 $email_text = __( 631 631 'Howdy, 632 632 633 633 Your request for an export of personal data has been completed. You may 634 634 download your personal data by clicking on the link below. For privacy -
src/wp-includes/user.php
3239 3239 'admin_email' => $admin_email, 3240 3240 ); 3241 3241 3242 $subject = sprintf( 3243 /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */ 3244 __( '[%1$s] Action Confirmed: %2$s' ), 3245 $email_data['sitename'], 3246 $action_description 3247 ); 3248 3249 /** 3250 * Filters the subject of the user request confirmation email. 3251 * 3252 * @since 4.9.8 3253 * 3254 * @param string $subject The email subject. 3255 * @param string $sitename The name of the site. 3256 * @param array $email_data { 3257 * Data relating to the account action email. 3258 * 3259 * @type WP_User_Request $request User request object. 3260 * @type string $user_email The email address confirming a request 3261 * @type string $description Description of the action being performed so the user knows what the email is for. 3262 * @type string $manage_url The link to click manage privacy requests of this type. 3263 * @type string $sitename The site name sending the mail. 3264 * @type string $siteurl The site URL sending the mail. 3265 * @type string $admin_email The administrator email receiving the mail. 3266 * } 3267 */ 3268 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); 3269 3242 3270 /* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */ 3243 $ email_text = __(3244 3271 $content = __( 3272 'Howdy, 3245 3273 3246 3274 A user data privacy request has been confirmed on ###SITENAME###: 3247 3275 … … 3260 3288 /** 3261 3289 * Filters the body of the user request confirmation email. 3262 3290 * 3291 * Use the {@see 'user_request_confirmed_email_content'} filter instead. 3292 * 3263 3293 * The email is sent to an administrator when an user request is confirmed. 3294 * 3264 3295 * The following strings have a special meaning and will get replaced dynamically: 3265 3296 * 3266 3297 * ###SITENAME### The name of the site. … … 3269 3300 * ###MANAGE_URL### The URL to manage requests. 3270 3301 * ###SITEURL### The URL to the site. 3271 3302 * 3303 * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3304 * 3272 3305 * @since 4.9.6 3273 3306 * 3274 * @param string $email_text Text in the email. 3307 * @deprecated 5.6.0 Use {@see 'user_request_confirmed_email_content'} filter instead. 3308 * @ignore This duplicate is deprecated and ignored to avoid documentation issues. 3309 * 3310 * @param string $content The email content. 3275 3311 * @param array $email_data { 3276 3312 * Data relating to the account action email. 3277 3313 * … … 3284 3320 * @type string $admin_email The administrator email receiving the mail. 3285 3321 * } 3286 3322 */ 3287 $content = apply_filters ( 'user_confirmed_action_email_content', $email_text, $email_data);3323 $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.6.0', 'user_request_confirmed_email_content' ); 3288 3324 3289 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );3290 $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );3291 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );3292 $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );3293 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );3294 3295 $subject = sprintf(3296 /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */3297 __( '[%1$s] Action Confirmed: %2$s' ),3298 $email_data['sitename'],3299 $action_description3300 );3301 3302 3325 /** 3303 * Filters the subjectof the user request confirmation email.3326 * Filters the body of the user request confirmation email. 3304 3327 * 3305 * @since 4.9.8 3328 * The email is sent to an administrator when an user request is confirmed. 3329 * The following strings have a special meaning and will get replaced dynamically: 3306 3330 * 3307 * @param string $subject The email subject. 3308 * @param string $sitename The name of the site. 3331 * ###SITENAME### The name of the site. 3332 * ###USER_EMAIL### The user email for the request. 3333 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. 3334 * ###MANAGE_URL### The URL to manage requests. 3335 * ###SITEURL### The URL to the site. 3336 * 3337 * For fulfillment email content use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3338 * 3339 * @since 5.6.0 3340 * 3341 * @param string $content The email content. 3309 3342 * @param array $email_data { 3310 3343 * Data relating to the account action email. 3311 3344 * … … 3318 3351 * @type string $admin_email The administrator email receiving the mail. 3319 3352 * } 3320 3353 */ 3321 $ subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );3354 $content = apply_filters( 'user_request_confirmed_email_content', $content, $email_data ); 3322 3355 3356 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3357 $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content ); 3358 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 3359 $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content ); 3360 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3361 3323 3362 $headers = ''; 3324 3363 3325 3364 /** … … 3410 3449 /** 3411 3450 * Filters the subject of the email sent when an erasure request is completed. 3412 3451 * 3452 * Use the {@see 'user_erasure_fulfillment_email_subject'} filter instead. 3453 * 3413 3454 * @since 4.9.8 3414 3455 * 3456 * @deprecated 5.6.0 Use {@see 'user_erasure_fulfillment_email_subject'} filter instead. 3457 * @ignore This duplicate is deprecated and ignored to avoid documentation issues. 3458 * 3415 3459 * @param string $subject The email subject. 3416 3460 * @param string $sitename The name of the site. 3417 3461 * @param array $email_data { … … 3426 3470 * @type string $siteurl The site URL sending the mail. 3427 3471 * } 3428 3472 */ 3429 $subject = apply_filters ( 'user_erasure_complete_email_subject', $subject, $email_data['sitename'], $email_data);3473 $subject = apply_filters_deprecated( 'user_erasure_complete_email_subject', array( $subject, $email_data['sitename'], $email_data ), '5.6.0', 'user_erasure_fulfillment_email_subject' ); 3430 3474 3431 if ( empty( $email_data['privacy_policy_url'] ) ) { 3432 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3433 $email_text = __( 3434 'Howdy, 3475 /** 3476 * Filters the subject of the email sent when an erasure request is completed. 3477 * 3478 * @since 5.6.0 3479 * 3480 * @param string $subject The email subject. 3481 * @param string $sitename The name of the site. 3482 * @param array $email_data { 3483 * Data relating to the account action email. 3484 * 3485 * @type WP_User_Request $request User request object. 3486 * @type string $message_recipient The address that the email will be sent to. Defaults 3487 * to the value of `$request->email`, but can be changed 3488 * by the `user_erasure_fulfillment_email_to` filter. 3489 * @type string $privacy_policy_url Privacy policy URL. 3490 * @type string $sitename The site name sending the mail. 3491 * @type string $siteurl The site URL sending the mail. 3492 * } 3493 */ 3494 $subject = apply_filters( 'user_erasure_fulfillment_email_subject', $subject, $email_data['sitename'], $email_data ); 3435 3495 3496 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3497 $content = __( 3498 'Howdy, 3499 3436 3500 Your request to erase your personal data on ###SITENAME### has been completed. 3437 3501 3438 3502 If you have any follow-up questions or concerns, please contact the site administrator. … … 3440 3504 Regards, 3441 3505 All at ###SITENAME### 3442 3506 ###SITEURL###' 3443 ); 3444 } else { 3507 ); 3508 3509 if ( ! empty( $email_data['privacy_policy_url'] ) ) { 3445 3510 /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */ 3446 $ email_text = __(3447 3511 $content = __( 3512 'Howdy, 3448 3513 3449 3514 Your request to erase your personal data on ###SITENAME### has been completed. 3450 3515 … … 3461 3526 /** 3462 3527 * Filters the body of the data erasure fulfillment notification. 3463 3528 * 3529 * Use the {@see 'user_erasure_fulfillment_email_content'} filter instead. 3530 * 3464 3531 * The email is sent to a user when a their data erasure request is fulfilled 3465 3532 * by an administrator. 3466 3533 * … … 3472 3539 * 3473 3540 * @since 4.9.6 3474 3541 * 3475 * @param string $email_text Text in the email. 3542 * @deprecated 5.6.0 Use {@see 'user_erasure_fulfillment_email_content'} filter instead. 3543 * @ignore This duplicate is deprecated and ignored to avoid documentation issues. 3544 * 3545 * @param string $content The email content. 3476 3546 * @param array $email_data { 3477 3547 * Data relating to the account action email. 3478 3548 * … … 3485 3555 * @type string $siteurl The site URL sending the mail. 3486 3556 * } 3487 3557 */ 3488 $content = apply_filters ( 'user_confirmed_action_email_content', $email_text, $email_data);3558 $content = apply_filters_deprecated( 'user_confirmed_action_email_content', array( $content, $email_data ), '5.6.0', 'user_erasure_fulfillment_email_content' ); 3489 3559 3560 /** 3561 * Filters the body of the data erasure fulfillment notification. 3562 * 3563 * The email is sent to a user when a their data erasure request is fulfilled 3564 * by an administrator. 3565 * 3566 * The following strings have a special meaning and will get replaced dynamically: 3567 * 3568 * ###SITENAME### The name of the site. 3569 * ###PRIVACY_POLICY_URL### Privacy policy page URL. 3570 * ###SITEURL### The URL to the site. 3571 * 3572 * @since 5.6.0 3573 * 3574 * @param string $content The email content. 3575 * @param array $email_data { 3576 * Data relating to the account action email. 3577 * 3578 * @type WP_User_Request $request User request object. 3579 * @type string $message_recipient The address that the email will be sent to. Defaults 3580 * to the value of `$request->email`, but can be changed 3581 * by the `user_erasure_fulfillment_email_to` filter. 3582 * @type string $privacy_policy_url Privacy policy URL. 3583 * @type string $sitename The site name sending the mail. 3584 * @type string $siteurl The site URL sending the mail. 3585 * } 3586 */ 3587 $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data ); 3588 3490 3589 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3491 3590 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 3492 3591 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); … … 3496 3595 /** 3497 3596 * Filters the headers of the data erasure fulfillment notification. 3498 3597 * 3598 * Use the {@see 'user_erasure_fulfillment_email_headers'} filter instead. 3599 * 3499 3600 * @since 5.4.0 3500 3601 * 3602 * @deprecated 5.6.0 Use {@see 'user_erasure_fulfillment_email_headers'} filter instead. 3603 * @ignore This duplicate is deprecated and ignored to avoid documentation issues. 3604 * 3501 3605 * @param string|array $headers The email headers. 3502 3606 * @param string $subject The email subject. 3503 3607 * @param string $content The email content. … … 3514 3618 * @type string $siteurl The site URL sending the mail. 3515 3619 * } 3516 3620 */ 3517 $headers = apply_filters ( 'user_erasure_complete_email_headers', $headers, $subject, $content, $request_id, $email_data);3621 $headers = apply_filters_deprecated( 'user_erasure_complete_email_headers', array( $headers, $subject, $content, $request_id, $email_data ), '5.6.0', 'user_erasure_fulfillment_email_headers' ); 3518 3622 3623 /** 3624 * Filters the headers of the data erasure fulfillment notification. 3625 * 3626 * @since 5.6.0 3627 * 3628 * @param string|array $headers The email headers. 3629 * @param string $subject The email subject. 3630 * @param string $content The email content. 3631 * @param int $request_id The request ID. 3632 * @param array $email_data { 3633 * Data relating to the account action email. 3634 * 3635 * @type WP_User_Request $request User request object. 3636 * @type string $message_recipient The address that the email will be sent to. Defaults 3637 * to the value of `$request->email`, but can be changed 3638 * by the `user_erasure_fulfillment_email_to` filter. 3639 * @type string $privacy_policy_url Privacy policy URL. 3640 * @type string $sitename The site name sending the mail. 3641 * @type string $siteurl The site URL sending the mail. 3642 * } 3643 */ 3644 $headers = apply_filters( 'user_erasure_fulfillment_email_headers', $headers, $subject, $content, $request_id, $email_data ); 3645 3519 3646 $email_sent = wp_mail( $user_email, $subject, $content, $headers ); 3520 3647 3521 3648 if ( $switched_locale ) { … … 3704 3831 'siteurl' => home_url(), 3705 3832 ); 3706 3833 3834 /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */ 3835 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] ); 3836 3837 /** 3838 * Filters the subject of the email sent when an account action is attempted. 3839 * 3840 * @since 4.9.6 3841 * 3842 * @param string $subject The email subject. 3843 * @param string $sitename The name of the site. 3844 * @param array $email_data { 3845 * Data relating to the account action email. 3846 * 3847 * @type WP_User_Request $request User request object. 3848 * @type string $email The email address this is being sent to. 3849 * @type string $description Description of the action being performed so the user knows what the email is for. 3850 * @type string $confirm_url The link to click on to confirm the account action. 3851 * @type string $sitename The site name sending the mail. 3852 * @type string $siteurl The site URL sending the mail. 3853 * } 3854 */ 3855 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3856 3707 3857 /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */ 3708 $ email_text = __(3709 3858 $content = __( 3859 'Howdy, 3710 3860 3711 3861 A request has been made to perform the following action on your account: 3712 3862 … … 3735 3885 * 3736 3886 * @since 4.9.6 3737 3887 * 3738 * @param string $ email_text Text in the email.3888 * @param string $content Text in the email. 3739 3889 * @param array $email_data { 3740 3890 * Data relating to the account action email. 3741 3891 * … … 3747 3897 * @type string $siteurl The site URL sending the mail. 3748 3898 * } 3749 3899 */ 3750 $content = apply_filters( 'user_request_action_email_content', $ email_text, $email_data );3900 $content = apply_filters( 'user_request_action_email_content', $content, $email_data ); 3751 3901 3752 3902 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 3753 3903 $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content ); … … 3755 3905 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3756 3906 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3757 3907 3758 /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */3759 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] );3760 3761 /**3762 * Filters the subject of the email sent when an account action is attempted.3763 *3764 * @since 4.9.63765 *3766 * @param string $subject The email subject.3767 * @param string $sitename The name of the site.3768 * @param array $email_data {3769 * Data relating to the account action email.3770 *3771 * @type WP_User_Request $request User request object.3772 * @type string $email The email address this is being sent to.3773 * @type string $description Description of the action being performed so the user knows what the email is for.3774 * @type string $confirm_url The link to click on to confirm the account action.3775 * @type string $sitename The site name sending the mail.3776 * @type string $siteurl The site URL sending the mail.3777 * }3778 */3779 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );3780 3781 3908 $headers = ''; 3782 3909 3783 3910 /** -
tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
210 210 * @ticket 44234 211 211 */ 212 212 public function test_email_subject_should_be_filterable() { 213 add_filter( 'user_erasure_ complete_email_subject', array( $this, 'filter_email_subject' ) );213 add_filter( 'user_erasure_fulfillment_email_subject', array( $this, 'filter_email_subject' ) ); 214 214 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 215 215 216 216 $mailer = tests_retrieve_phpmailer_instance(); … … 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(); … … 264 264 * @ticket 44501 265 265 */ 266 266 public function test_email_headers_should_be_filterable() { 267 add_filter( 'user_erasure_ complete_email_headers', array( $this, 'modify_email_headers' ) );267 add_filter( 'user_erasure_fulfillment_email_headers', array( $this, 'modify_email_headers' ) ); 268 268 _wp_privacy_send_erasure_fulfillment_notification( self::$request_id ); 269 269 270 270 $mailer = tests_retrieve_phpmailer_instance(); -
tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
176 176 177 177 _wp_privacy_account_request_confirmed( $request_id ); 178 178 179 add_filter( 'user_ confirmed_action_email_content', array( $this, 'modify_email_content' ), 10, 2 );179 add_filter( 'user_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10, 2 ); 180 180 _wp_privacy_send_request_confirmation_notification( $request_id ); 181 remove_filter( 'user_ confirmed_action_email_content', array( $this, 'modify_email_content' ), 10 );181 remove_filter( 'user_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10 ); 182 182 183 183 $mailer = tests_retrieve_phpmailer_instance(); 184 184 $this->assertContains( 'Custom content containing email address:' . $email, $mailer->get_sent()->body ); -
tests/qunit/fixtures/wp-api-generated.js
4469 4469 "attributes": { 4470 4470 "required": false, 4471 4471 "default": [], 4472 "description": "Attributes for the block ",4472 "description": "Attributes for the block.", 4473 4473 "type": "object" 4474 4474 }, 4475 4475 "post_id": { … … 4563 4563 "args": { 4564 4564 "name": { 4565 4565 "required": false, 4566 "description": "Block name ",4566 "description": "Block name.", 4567 4567 "type": "string" 4568 4568 }, 4569 4569 "namespace": { 4570 4570 "required": false, 4571 "description": "Block namespace ",4571 "description": "Block namespace.", 4572 4572 "type": "string" 4573 4573 }, 4574 4574 "context": {