Edit File by line
/home/barbar84/www/wp-admin
File: ms-delete-site.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Multisite delete site panel.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Multisite
[5] Fix | Delete
* @since 3.0.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
if ( ! is_multisite() ) {
[11] Fix | Delete
wp_die( __( 'Multisite support is not enabled.' ) );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
if ( ! current_user_can( 'delete_site' ) ) {
[15] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to delete this site.' ) );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
if ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) {
[19] Fix | Delete
if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) {
[20] Fix | Delete
wpmu_delete_blog( get_current_blog_id() );
[21] Fix | Delete
wp_die(
[22] Fix | Delete
sprintf(
[23] Fix | Delete
/* translators: %s: Network title. */
[24] Fix | Delete
__( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ),
[25] Fix | Delete
get_network()->site_name
[26] Fix | Delete
)
[27] Fix | Delete
);
[28] Fix | Delete
} else {
[29] Fix | Delete
wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) );
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
$blog = get_site();
[34] Fix | Delete
$user = wp_get_current_user();
[35] Fix | Delete
[36] Fix | Delete
$title = __( 'Delete Site' );
[37] Fix | Delete
$parent_file = 'tools.php';
[38] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[39] Fix | Delete
[40] Fix | Delete
echo '<div class="wrap">';
[41] Fix | Delete
echo '<h1>' . esc_html( $title ) . '</h1>';
[42] Fix | Delete
[43] Fix | Delete
if ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) {
[44] Fix | Delete
check_admin_referer( 'delete-blog' );
[45] Fix | Delete
[46] Fix | Delete
$hash = wp_generate_password( 20, false );
[47] Fix | Delete
update_option( 'delete_blog_hash', $hash );
[48] Fix | Delete
[49] Fix | Delete
$url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) );
[50] Fix | Delete
[51] Fix | Delete
$switched_locale = switch_to_locale( get_locale() );
[52] Fix | Delete
[53] Fix | Delete
/* translators: Do not translate USERNAME, URL_DELETE, SITENAME, SITEURL: those are placeholders. */
[54] Fix | Delete
$content = __(
[55] Fix | Delete
"Howdy ###USERNAME###,
[56] Fix | Delete
[57] Fix | Delete
You recently clicked the 'Delete Site' link on your site and filled in a
[58] Fix | Delete
form on that page.
[59] Fix | Delete
[60] Fix | Delete
If you really want to delete your site, click the link below. You will not
[61] Fix | Delete
be asked to confirm again so only click this link if you are absolutely certain:
[62] Fix | Delete
###URL_DELETE###
[63] Fix | Delete
[64] Fix | Delete
If you delete your site, please consider opening a new site here
[65] Fix | Delete
some time in the future! (But remember your current site and username
[66] Fix | Delete
are gone forever.)
[67] Fix | Delete
[68] Fix | Delete
Thanks for using the site,
[69] Fix | Delete
All at ###SITENAME###
[70] Fix | Delete
###SITEURL###"
[71] Fix | Delete
);
[72] Fix | Delete
/**
[73] Fix | Delete
* Filters the text for the email sent to the site admin when a request to delete a site in a Multisite network is submitted.
[74] Fix | Delete
*
[75] Fix | Delete
* @since 3.0.0
[76] Fix | Delete
*
[77] Fix | Delete
* @param string $content The email text.
[78] Fix | Delete
*/
[79] Fix | Delete
$content = apply_filters( 'delete_site_email_content', $content );
[80] Fix | Delete
[81] Fix | Delete
$content = str_replace( '###USERNAME###', $user->user_login, $content );
[82] Fix | Delete
$content = str_replace( '###URL_DELETE###', $url_delete, $content );
[83] Fix | Delete
$content = str_replace( '###SITENAME###', get_network()->site_name, $content );
[84] Fix | Delete
$content = str_replace( '###SITEURL###', network_home_url(), $content );
[85] Fix | Delete
[86] Fix | Delete
wp_mail(
[87] Fix | Delete
get_option( 'admin_email' ),
[88] Fix | Delete
sprintf(
[89] Fix | Delete
/* translators: %s: Site title. */
[90] Fix | Delete
__( '[%s] Delete My Site' ),
[91] Fix | Delete
wp_specialchars_decode( get_option( 'blogname' ) )
[92] Fix | Delete
),
[93] Fix | Delete
$content
[94] Fix | Delete
);
[95] Fix | Delete
[96] Fix | Delete
if ( $switched_locale ) {
[97] Fix | Delete
restore_previous_locale();
[98] Fix | Delete
}
[99] Fix | Delete
?>
[100] Fix | Delete
[101] Fix | Delete
<p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p>
[102] Fix | Delete
[103] Fix | Delete
<?php
[104] Fix | Delete
} else {
[105] Fix | Delete
?>
[106] Fix | Delete
<p>
[107] Fix | Delete
<?php
[108] Fix | Delete
printf(
[109] Fix | Delete
/* translators: %s: Network title. */
[110] Fix | Delete
__( '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.' ),
[111] Fix | Delete
get_network()->site_name
[112] Fix | Delete
);
[113] Fix | Delete
?>
[114] Fix | Delete
</p>
[115] Fix | Delete
<p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p>
[116] Fix | Delete
[117] Fix | Delete
<form method="post" name="deletedirect">
[118] Fix | Delete
<?php wp_nonce_field( 'delete-blog' ); ?>
[119] Fix | Delete
<input type="hidden" name="action" value="deleteblog" />
[120] Fix | Delete
<p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong>
[121] Fix | Delete
<?php
[122] Fix | Delete
printf(
[123] Fix | Delete
/* translators: %s: Site address. */
[124] Fix | Delete
__( "I'm sure I want to permanently delete my site, and I am aware I can never get it back or use %s again." ),
[125] Fix | Delete
$blog->domain . $blog->path
[126] Fix | Delete
);
[127] Fix | Delete
?>
[128] Fix | Delete
</strong></label></p>
[129] Fix | Delete
<?php submit_button( __( 'Delete My Site Permanently' ) ); ?>
[130] Fix | Delete
</form>
[131] Fix | Delete
<?php
[132] Fix | Delete
}
[133] Fix | Delete
echo '</div>';
[134] Fix | Delete
[135] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[136] Fix | Delete
[137] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function