Mail: Replace empty site title with domain name in email subjects.

This change replaces site title with domain name in email subjects when the `blogname` option is empty.

Props Presskopp, kebbet, audrasjb, azouamauriac.
Fixes #54760.


git-svn-id: https://develop.svn.wordpress.org/trunk@53063 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-04-04 20:19:12 +00:00
parent 671d2caa29
commit ccdb078d08
4 changed files with 33 additions and 5 deletions

View File

@@ -1472,12 +1472,18 @@ All at ###SITENAME###
$content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
$content = str_replace( '###SITEURL###', home_url(), $content );
if ( '' !== get_option( 'blogname' ) ) {
$site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
} else {
$site_title = parse_url( home_url(), PHP_URL_HOST );
}
wp_mail(
$value,
sprintf(
/* translators: New admin email address notification email subject. %s: Site title. */
__( '[%s] New Admin Email Address' ),
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
$site_title
),
$content
);