diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index 7ba6b71b52..a0405fd0a3 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -1236,9 +1236,15 @@ class WP_Automatic_Updater { $body[] = __( 'https://wordpress.org/support/forums/' ); $body[] = "\n" . __( 'The WordPress Team' ); + if ( '' !== get_option( 'blogname' ) ) { + $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + } else { + $site_title = parse_url( home_url(), PHP_URL_HOST ); + } + $body = implode( "\n", $body ); $to = get_site_option( 'admin_email' ); - $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ); + $subject = sprintf( $subject, $site_title ); $headers = ''; $email = compact( 'to', 'subject', 'body', 'headers' ); @@ -1347,7 +1353,11 @@ class WP_Automatic_Updater { $body[] = ''; } - $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); + if ( '' !== get_bloginfo( 'name' ) ) { + $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); + } else { + $site_title = parse_url( home_url(), PHP_URL_HOST ); + } if ( $failures ) { $body[] = trim( diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index aeeccc9b6f..3b4b6f3e47 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -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 ); diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 6563859ef7..64b91fce19 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -578,6 +578,12 @@ function admin_created_user_email( $text ) { $roles = get_editable_roles(); $role = $roles[ $_REQUEST['role'] ]; + if ( '' !== get_bloginfo( 'name' ) ) { + $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); + } else { + $site_title = parse_url( home_url(), PHP_URL_HOST ); + } + return sprintf( /* translators: 1: Site title, 2: Site URL, 3: User role. */ __( @@ -590,7 +596,7 @@ this email. This invitation will expire in a few days. Please click the following link to activate your user account: %%s' ), - wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), + $site_title, home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ) ); diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index 220e0c53eb..4bc2d133cd 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -112,6 +112,12 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' === $_REQUEST['action'] ) { $switched_locale = switch_to_locale( get_user_locale( $user_details ) ); + if ( '' !== get_option( 'blogname' ) ) { + $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + } else { + $site_title = parse_url( home_url(), PHP_URL_HOST ); + } + /* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */ $message = __( 'Hi, @@ -127,7 +133,7 @@ Please click the following link to confirm the invite: $new_user_email['subject'] = sprintf( /* translators: Joining confirmation notification email subject. %s: Site title. */ __( '[%s] Joining Confirmation' ), - wp_specialchars_decode( get_option( 'blogname' ) ) + $site_title ); $new_user_email['message'] = sprintf( $message, diff --git a/wp-includes/version.php b/wp-includes/version.php index f74b846764..cb0a65721c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53062'; +$wp_version = '6.0-alpha-53063'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.