diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/ms-delete-site.php --- a/wp/wp-admin/ms-delete-site.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/ms-delete-site.php Tue Dec 15 13:49:49 2020 +0100 @@ -7,7 +7,7 @@ * @since 3.0.0 */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! is_multisite() ) { wp_die( __( 'Multisite support is not enabled.' ) ); @@ -17,10 +17,16 @@ wp_die( __( 'Sorry, you are not allowed to delete this site.' ) ); } -if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) { +if ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) { if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) { wpmu_delete_blog( get_current_blog_id() ); - wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) ); + wp_die( + sprintf( + /* translators: %s: Network title. */ + __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), + get_network()->site_name + ) + ); } else { wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) ); } @@ -31,12 +37,12 @@ $title = __( 'Delete Site' ); $parent_file = 'tools.php'; -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; echo '
'; echo '

' . esc_html( $title ) . '

'; -if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_POST['confirmdelete'] ) && $_POST['confirmdelete'] == '1' ) { +if ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) { check_admin_referer( 'delete-blog' ); $hash = wp_generate_password( 20, false ); @@ -46,7 +52,7 @@ $switched_locale = switch_to_locale( get_locale() ); - /* translators: Do not translate USERNAME, URL_DELETE, SITE_NAME: those are placeholders. */ + /* translators: Do not translate USERNAME, URL_DELETE, SITENAME, SITEURL: those are placeholders. */ $content = __( "Howdy ###USERNAME###, @@ -62,8 +68,8 @@ are gone forever.) Thanks for using the site, -Webmaster -###SITE_NAME###" +All at ###SITENAME### +###SITEURL###" ); /** * Filters the email content sent when a site in a Multisite network is deleted. @@ -76,9 +82,18 @@ $content = str_replace( '###USERNAME###', $user->user_login, $content ); $content = str_replace( '###URL_DELETE###', $url_delete, $content ); - $content = str_replace( '###SITE_NAME###', get_network()->site_name, $content ); + $content = str_replace( '###SITENAME###', get_network()->site_name, $content ); + $content = str_replace( '###SITEURL###', network_home_url(), $content ); - wp_mail( get_option( 'admin_email' ), '[ ' . wp_specialchars_decode( get_option( 'blogname' ) ) . ' ] ' . __( 'Delete My Site' ), $content ); + wp_mail( + get_option( 'admin_email' ), + sprintf( + /* translators: %s: Site title. */ + __( '[%s] Delete My Site' ), + wp_specialchars_decode( get_option( 'blogname' ) ) + ), + $content + ); if ( $switched_locale ) { restore_previous_locale(); @@ -90,7 +105,15 @@ -

Delete My Site Permanently you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?>

+

+ Delete My Site Permanently you will be sent an email with a link in it. Click on this link to delete your site.' ), + get_network()->site_name + ); + ?> +

@@ -99,8 +122,8 @@

'; -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php';