Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#54760 closed enhancement (fixed)

If Site Title is empty don't use '[ ]' as site title in email but domain name

Reported by: presskopp's profile Presskopp Owned by: audrasjb's profile audrasjb
Milestone: 6.0 Priority: normal
Severity: normal Version: 5.5
Component: Mail Keywords: has-patch commit assigned-for-commit
Focuses: administration Cc:


In the email you get when a plugin was automatically updated or if core has been updated, if no site title is set, you'll get something like:

[] Your site has updated ...

while it should be something like [site title] Your site has updated ...

In that case I'd like to see the domain name as the title like in

[] Your site has updated ...

This could be archived by something like

if ( '' != $site_title ) {
        $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
        } else {
        $site_title = parse_url( home_url(), PHP_URL_HOST );

in class-wp-automatic-updater.php ~ L.1350

Change History (13)

This ticket was mentioned in PR #2121 on WordPress/wordpress-develop by kebbet.

3 years ago

  • Keywords has-patch added

#2 @kebbet
3 years ago

  • Keywords needs-testing added

Added the same logics to the function send_plugin_theme_email that uses the same original pattern, in the linked PR.

Last edited 3 years ago by kebbet (previous) (diff)

#3 @kebbet
3 years ago

  • Focuses administration added
  • Version set to 5.5

#4 @audrasjb
3 years ago

  • Milestone changed from Awaiting Review to 6.0
  • Owner set to audrasjb
  • Status changed from new to reviewing

Looks like a nice improvement for 6.0 :)

#5 @audrasjb
3 years ago

  • Keywords needs-refresh added; needs-testing removed

The patch looks good but the same logic should also be used in other emails that are using [%s] (where %s stands for get_bloginfo( 'name' ).

#6 @kebbet
3 years ago

Ok, I can adjust the patch for that, can only find one more place: in user.php on L592.

What about get_option( 'blogname' )? I.e. user-new.php L130.

mauriac commented on PR #2121:

2 years ago

Hi @kebbet good work, i have a suggestion, can we wrap the new block in new function, that will be nice as the block is repetitive now. what do you think about?

kebbet commented on PR #2121:

2 years ago

Thanks @mauriac, I was thinking the same, but was unsure about where to place that functions. Any suggestions?

mauriac commented on PR #2121:

2 years ago

I'll suggest src/wp-admin/includes/functions.php.

But let's ask committers if they're ok with that, and may be they have any suggestion.

@SergeyBiryukov @audrasjb

audrasjb commented on PR #2121:

2 years ago

wp-admin/includes/functions.php would work, but I'm not sure a specific function is really needed for this… any thought @SergeyBiryukov ?

#11 @audrasjb
2 years ago

  • Keywords commit assigned-for-commit added; needs-refresh removed

As I'm not sure this feature deserves its own function, let's commit it as it is right now. We can still add the function later if needed.

#12 @audrasjb
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 53063:

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.

Note: See TracTickets for help on using tickets.