Better table matching on multisite, hat tip to @claudiulodro for pointing me in the right direction.
This commit is contained in:
parent
beaa610cc0
commit
3cda8c439c
|
@ -721,12 +721,11 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
|
|||
'index' => 0,
|
||||
);
|
||||
|
||||
$site_tables = $wpdb->tables( 'all', 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() ) {
|
||||
if ( 0 !== strpos( $table->name, $wpdb->prefix ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( is_multisite() && ! in_array( $table->name, $site_tables, true ) ) {
|
||||
continue;
|
||||
}
|
||||
$table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other';
|
||||
|
||||
|
|
Loading…
Reference in New Issue