Multisite: Use get_network() and get_current_network_id() for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`. This effectively deprecates `get_current_site()`, something that we'll do in a future ticket. Props flixos90. Fixes #37414. Built from https://develop.svn.wordpress.org/trunk@38814 git-svn-id: http://core.svn.wordpress.org/trunk@38757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -18,7 +18,7 @@ if ( ! current_user_can( 'delete_site' ) )
|
||||
if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
|
||||
if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
|
||||
wpmu_delete_blog( $wpdb->blogid );
|
||||
wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), $current_site->site_name ) );
|
||||
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 ) );
|
||||
} else {
|
||||
wp_die( __( "I'm sorry, the link you clicked is stale. Please select another option." ) );
|
||||
}
|
||||
@@ -70,7 +70,7 @@ Webmaster
|
||||
|
||||
$content = str_replace( '###USERNAME###', $user->user_login, $content );
|
||||
$content = str_replace( '###URL_DELETE###', $url_delete, $content );
|
||||
$content = str_replace( '###SITE_NAME###', $current_site->site_name, $content );
|
||||
$content = str_replace( '###SITE_NAME###', get_network()->site_name, $content );
|
||||
|
||||
wp_mail( get_option( 'admin_email' ), "[ " . wp_specialchars_decode( get_option( 'blogname' ) ) . " ] ".__( 'Delete My Site' ), $content );
|
||||
?>
|
||||
@@ -79,7 +79,7 @@ Webmaster
|
||||
|
||||
<?php } else {
|
||||
?>
|
||||
<p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.'), $current_site->site_name); ?></p>
|
||||
<p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.'), get_network()->site_name); ?></p>
|
||||
<p><?php _e( 'Remember, once deleted your site cannot be restored.' ) ?></p>
|
||||
|
||||
<form method="post" name="deletedirect">
|
||||
|
||||
Reference in New Issue
Block a user