From ac269e570e1b76e1e61cec7e6ace5e9f232edf82 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 28 Jun 2018 02:41:13 +0000 Subject: [PATCH] Privacy: filter the email subject in `_wp_privacy_send_request_confirmation_notification()`. Props garrett-eclipse, birgire, desrosj. Fixes #44382. Built from https://develop.svn.wordpress.org/trunk@43373 git-svn-id: http://core.svn.wordpress.org/trunk@43201 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 36 ++++++++++++++++++++++++++++++------ wp-includes/version.php | 2 +- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 73c3f3c2fe..3d940e16e9 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2973,12 +2973,6 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) { return; } - $subject = sprintf( - /* translators: %s Site name. */ - __( '[%s] Action Confirmed' ), - wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) - ); - $manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) ); /** @@ -3049,6 +3043,7 @@ All at ###SITENAME### * @type string $manage_url The link to click manage privacy requests of this type. * @type string $sitename The site name sending the mail. * @type string $siteurl The site URL sending the mail. + * @type string $admin_email The administrator email receiving the mail. * } */ $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); @@ -3059,6 +3054,35 @@ All at ###SITENAME### $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content ); $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); + $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + + $subject = sprintf( + /* translators: %s Site name. */ + __( '[%s] Action Confirmed' ), + $blogname + ); + + /** + * Filters the subject of the user request confirmation email. + * + * @since 4.9.7 + * + * @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 $user_email The email address confirming a request + * @type string $description Description of the action being performed so the user knows what the email is for. + * @type string $manage_url The link to click manage privacy requests of this type. + * @type string $sitename The site name sending the mail. + * @type string $siteurl The site URL sending the mail. + * @type string $admin_email The administrator email receiving the mail. + * } + */ + $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $blogname, $email_data ); + $email_sent = wp_mail( $email_data['admin_email'], $subject, $content ); if ( $email_sent ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index beb4abf6e8..7f77cefc4d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43371'; +$wp_version = '5.0-alpha-43373'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.