From a0e67e1331f8734f58df2dde68e3e2cace13e5ba Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 9 May 2018 17:50:56 +0000 Subject: [PATCH] Privacy: add request type and filter to the subject of request confirmation emails for GDPR. Props desrosj, azaozz. See #43968. git-svn-id: https://develop.svn.wordpress.org/trunk@43197 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/user.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 2ceb96411e..0e6e13537e 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -3141,8 +3141,33 @@ All at ###SITENAME### $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content ); $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); + $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + + /* translators: Privacy data request subject. 1: Site name, 2: Name of the action */ + $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $blogname, $email_data['description'] ); + + /** + * Filters the subject of the email sent when an account action is attempted. + * + * @since 4.9.6 + * + * @param string $subject The email subject. + * @param string $blogname The name of the site. + * @param array $email_data { + * Data relating to the account action email. + * + * @type WP_User_Request $request User request object. + * @type string $email The email address this is being sent to. + * @type string $description Description of the action being performed so the user knows what the email is for. + * @type string $confirm_url The link to click on to confirm the account action. + * @type string $sitename The site name sending the mail. + * @type string $siteurl The site URL sending the mail. + * } + */ + $subject = apply_filters( 'user_request_action_email_subject', $subject, $blogname, $email_data ); + /* translators: %s Site name. */ - return wp_mail( $email_data['email'], sprintf( __( '[%s] Confirm Action' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content ); + return wp_mail( $email_data['email'], $subject, $content ); } /**