WC_Install::verify_base_tables │ public static │ WC 1.0

Check if all the base tables are present, updating the stored schema status accordingly.

Метод класса: WC_Install{}

Хуков нет.

Возвращает

string[]. List of missing table names.

Использование

$result = WC_Install::verify_base_tables( $modify_notice, $execute );
$modify_notice(true|false)
Whether to modify notice based on if all tables are present.
По умолчанию: true
$execute(true|false)
Whether to execute get_schema queries as well.
По умолчанию: false

Код WC_Install::verify_base_tables() WC 11.2.2

public static function verify_base_tables( $modify_notice = true, $execute = false ) {
	if ( $execute ) {
		self::create_tables();
	}

	$missing_tables = self::get_missing_base_tables();

	if ( 0 < count( $missing_tables ) ) {
		update_option( 'woocommerce_schema_missing_tables', $missing_tables );
	} else {
		if ( $modify_notice ) {
			WC_Admin_Notices::remove_notice( 'base_tables_missing' );
		}
		update_option( 'woocommerce_schema_version', WC()->db_version );
		delete_option( 'woocommerce_schema_missing_tables' );
	}
	return $missing_tables;
}