Define WC tables in wpmu_drop_tables

Closes #5396
This commit is contained in:
Mike Jolley 2014-10-10 14:48:08 +01:00
parent bf885f846e
commit 38000b1785
2 changed files with 24 additions and 0 deletions

View File

@ -32,6 +32,10 @@ class WC_Install {
add_action( 'in_plugin_update_message-woocommerce/woocommerce.php', array( $this, 'in_plugin_update_message' ) );
add_filter( 'plugin_action_links_' . WC_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
if ( is_multisite() ) {
add_filter( 'wpmu_drop_tables', array( $this, 'wpmu_drop_tables' ) );
}
}
/**
@ -727,6 +731,25 @@ class WC_Install {
return (array) $links;
}
/**
* Uninstall tables when MU blog is deleted.
* @param array $tables
* @return array
*/
public function wpmu_drop_tables( $tables ) {
global $wpdb;
$tables[] = $wpdb->prefix . "woocommerce_attribute_taxonomies";
$tables[] = $wpdb->prefix . "woocommerce_downloadable_product_permissions";
$tables[] = $wpdb->prefix . "woocommerce_termmeta";
$tables[] = $wpdb->prefix . "woocommerce_tax_rates";
$tables[] = $wpdb->prefix . "woocommerce_tax_rate_locations";
$tables[] = $wpdb->prefix . "woocommerce_order_items";
$tables[] = $wpdb->prefix . "woocommerce_order_itemmeta";
return $tables;
}
}
endif;

View File

@ -143,6 +143,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Logic in wc_paying_customer to only increase for 'simple' orders.
* Tweak - Added tool to refresh stats to customer list.
* Tweak - Recent order table on my account is responsive.
* Tweak - Drop WC tables in wpmu_drop_tables (for multisite).
* Dev - Made template debug mode set WC_TEMPLATE_DEBUG_MODE constant and remove all overrides for all template loading functions.
= 2.2.5 - 07/10/2014 =