WC_Install::get_missing_base_tables
Get the names of any missing WooCommerce base tables.
Unlike verify_base_tables(), this method has no side effects: it only inspects the database and reports which required tables are missing.
Method of the class: WC_Install{}
No Hooks.
Returns
String[]. List of missing table names.
Usage
$result = WC_Install::get_missing_base_tables(): array;
Changelog
| Since 11.0.0 | Introduced. |
WC_Install::get_missing_base_tables() WC Install::get missing base tables code WC 11.0.1
public static function get_missing_base_tables(): array {
$schema = self::get_schema();
$hpos_settings = filter_var_array(
array(
'cot' => get_option( CustomOrdersTableController::CUSTOM_ORDERS_TABLE_USAGE_ENABLED_OPTION ),
'data_sync' => get_option( DataSynchronizer::ORDERS_DATA_SYNC_ENABLED_OPTION ),
),
array(
'cot' => FILTER_VALIDATE_BOOLEAN,
'data_sync' => FILTER_VALIDATE_BOOLEAN,
)
);
if ( in_array( true, $hpos_settings, true ) ) {
$schema .= wc_get_container()
->get( OrdersTableDataStore::class )
->get_database_schema();
}
return wc_get_container()
->get( DatabaseUtil::class )
->get_missing_tables( $schema );
}