reallydeleteblog = false; add_action('admin_menu', array(&$this, 'admin_menu')); add_action('admin_footer', array(&$this, 'admin_footer')); } function admin_footer() { global $wpdb; if( $this->reallydeleteblog == true ) { wpmu_delete_blog( $wpdb->blogid ); } } function admin_menu() { add_submenu_page('options-general.php', __('Delete Blog'), __('Delete Blog'), 'manage_options', 'delete-blog', array(&$this, 'plugin_content')); } function plugin_content() { global $wpdb, $current_blog, $current_site; $this->delete_blog_hash = get_settings('delete_blog_hash'); echo '

' . __('Delete Blog') . '

'; if( $_POST[ 'action' ] == "deleteblog" && $_POST[ 'confirmdelete' ] == '1' ) { $hash = substr( md5( $_SERVER[ 'REQUEST_URI' ] . time() ), 0, 6 ); update_option( "delete_blog_hash", $hash ); $url_delete = get_option( "siteurl" ) . "/wp-admin/options-general.php?page=delete-blog&h=" . $hash; $msg = __("Dear User, You recently clicked the 'Delete Blog' link on your blog and filled in a form on that page. If you really want to delete your blog, click the link below. You will not be asked to confirm again so only click this link if you are 100% certain: URL_DELETE If you delete your blog, please consider opening a new blog here some time in the future! (But remember your current blog and username are gone forever.) Thanks for using the site, Webmaster SITE_NAME "); $msg = str_replace( "URL_DELETE", $url_delete, $msg ); $msg = str_replace( "SITE_NAME", $current_site->site_name, $msg ); wp_mail( get_option( "admin_email" ), "[ " . get_option( "blogname" ) . " ] ".__("Delete My Blog"), $msg ); ?>

reallydeleteblog = true; echo "

" . sprintf(__('Thank you for using %s, your blog has been deleted. Happy trails to you until we meet again.'), $current_site->site_name) . "

"; } else { $this->reallydeleteblog = false; echo "

" . __("I'm sorry, the link you clicked is stale. Please select another option.") . "

"; } } else { ?>

Delete My Blog you will be sent an email with a link in it. Click on this link to delete your blog.'), $current_site->site_name); ?>

' />

"; } } $delete_blog_obj = new delete_blog(); ?>