fix: Various 'Table does not exist' in WooCommerce status

This commit is contained in:
nishitlangaliya 2018-10-27 11:20:21 -08:00
parent d1c90c5972
commit e275bf2b1d
1 changed files with 2 additions and 2 deletions

View File

@ -721,10 +721,10 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
'index' => 0,
);
$site_tables = $wpdb->tables( 'all', true );
$site_tables_prefix = $wpdb->get_blog_prefix( get_current_blog_id() );
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() && ! in_array( $table->name, $site_tables, true ) ) {
if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) ) {
continue;
}
$table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other';