fix: global table included along with multisite tables

This commit is contained in:
nishitlangaliya 2018-10-30 20:50:09 +05:30
parent e275bf2b1d
commit e7b9056c58
1 changed files with 2 additions and 1 deletions

View File

@ -722,9 +722,10 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
);
$site_tables_prefix = $wpdb->get_blog_prefix( get_current_blog_id() );
$global_tables = $wpdb->tables( 'global', true );
foreach ( $database_table_sizes as $table ) {
// Only include tables matching the prefix of the current site, this is to prevent displaying all tables on a MS install not relating to the current.
if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) ) {
if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) && ! in_array( $table->name, $global_tables, true ) ) {
continue;
}
$table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other';