summaryrefslogtreecommitdiffstats
path: root/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 13:43:38 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 13:43:38 +0000
commit034c1b3b665fa28816dfc6157d610c6d25fd54fe (patch)
treea971b2ce31c1bf0eff18211fbb6a0603d20507f3 /wp-admin
parent541e47c09b503df8bd9b6d149c82cb8d98ac2710 (diff)
downloadwordpress-mu-034c1b3b665fa28816dfc6157d610c6d25fd54fe.tar.gz
wordpress-mu-034c1b3b665fa28816dfc6157d610c6d25fd54fe.tar.xz
wordpress-mu-034c1b3b665fa28816dfc6157d610c6d25fd54fe.zip
Delete all tables of a blog, not just the WP ones, props jamescollins and lunabyte, fixes #669
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1343 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r--wp-admin/includes/mu.php21
1 files changed, 4 insertions, 17 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 46d321a..8d7aa1a 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -41,25 +41,12 @@ function wpmu_delete_blog($blog_id, $drop = false) {
update_blog_status( $blog_id, 'deleted', 1 );
if ( $drop ) {
- $drop_tables = array( $wpdb->base_prefix . $blog_id . "_categories",
- $wpdb->base_prefix . $blog_id . "_comments",
- $wpdb->base_prefix . $blog_id . "_linkcategories",
- $wpdb->base_prefix . $blog_id . "_links",
- $wpdb->base_prefix . $blog_id . "_link2cat",
- $wpdb->base_prefix . $blog_id . "_options",
- $wpdb->base_prefix . $blog_id . "_post2cat",
- $wpdb->base_prefix . $blog_id . "_postmeta",
- $wpdb->base_prefix . $blog_id . "_posts",
- $wpdb->base_prefix . $blog_id . "_terms",
- $wpdb->base_prefix . $blog_id . "_term_taxonomy",
- $wpdb->base_prefix . $blog_id . "_term_relationships" );
-
+ $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "_%'", ARRAY_A);
$drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables );
- reset( $drop_tables );
- foreach ( (array) $drop_tables as $drop_table) {
- $wpdb->query( "DROP TABLE IF EXISTS $drop_table" );
- }
+ reset( $drop_tables );
+ foreach ( (array) $drop_tables as $drop_table => $name )
+ $wpdb->query( "DROP TABLE IF EXISTS ". current( $name ) ."" );
$wpdb->query( "DELETE FROM $wpdb->blogs WHERE blog_id = '$blog_id'" );
$dir = constant( "ABSPATH" ) . "wp-content/blogs.dir/{$blog_id}/files/";