Administration: Introduce `new_admin_email_subject` filter.

This changeset introduces the `new_admin_email_subject` hook which allow developers to filter the subject of the email sent when a change of site admin email address is attempted.

Props MadtownLems, johnbillion, alexanderkoledov, shooper, Marc_J, nikmeyer, xlthlx, devmuhib, nuhel, audrasjb.
Fixes #59250.




Built from https://develop.svn.wordpress.org/trunk@57283


git-svn-id: http://core.svn.wordpress.org/trunk@56789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2024-01-14 11:01:17 +00:00
parent 4d2c122564
commit f16bd4cac4
2 changed files with 16 additions and 9 deletions

View File

@ -1531,16 +1531,23 @@ All at ###SITENAME###
$site_title = parse_url( home_url(), PHP_URL_HOST ); $site_title = parse_url( home_url(), PHP_URL_HOST );
} }
wp_mail( $subject = sprintf(
$value, /* translators: New admin email address notification email subject. %s: Site title. */
sprintf( __( '[%s] New Admin Email Address' ),
/* translators: New admin email address notification email subject. %s: Site title. */ $site_title
__( '[%s] New Admin Email Address' ),
$site_title
),
$content
); );
/**
* Filters the subject of the email sent when a change of site admin email address is attempted.
*
* @since 6.5.0
*
* @param string $subject Subject of the email.
*/
$subject = apply_filters( 'new_admin_email_subject', $subject );
wp_mail( $value, $subject, $content );
if ( $switched_locale ) { if ( $switched_locale ) {
restore_previous_locale(); restore_previous_locale();
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-alpha-57282'; $wp_version = '6.5-alpha-57283';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.