WC_Install::get_tables()public staticWC 1.0

Return a list of WooCommerce tables. Used to make sure all WC tables are dropped when uninstalling the plugin in a single site or multi site environment.

Method of the class: WC_Install{}

Hooks from the method

Return

Array. WC tables.

Usage

$result = WC_Install::get_tables();

WC_Install::get_tables() code WC 9.3.1

public static function get_tables() {
	global $wpdb;

	$tables = array(
		"{$wpdb->prefix}wc_download_log",
		"{$wpdb->prefix}wc_product_download_directories",
		"{$wpdb->prefix}wc_product_meta_lookup",
		"{$wpdb->prefix}wc_tax_rate_classes",
		"{$wpdb->prefix}wc_webhooks",
		"{$wpdb->prefix}woocommerce_api_keys",
		"{$wpdb->prefix}woocommerce_attribute_taxonomies",
		"{$wpdb->prefix}woocommerce_downloadable_product_permissions",
		"{$wpdb->prefix}woocommerce_log",
		"{$wpdb->prefix}woocommerce_order_itemmeta",
		"{$wpdb->prefix}woocommerce_order_items",
		"{$wpdb->prefix}woocommerce_payment_tokenmeta",
		"{$wpdb->prefix}woocommerce_payment_tokens",
		"{$wpdb->prefix}woocommerce_sessions",
		"{$wpdb->prefix}woocommerce_shipping_zone_locations",
		"{$wpdb->prefix}woocommerce_shipping_zone_methods",
		"{$wpdb->prefix}woocommerce_shipping_zones",
		"{$wpdb->prefix}woocommerce_tax_rate_locations",
		"{$wpdb->prefix}woocommerce_tax_rates",
		"{$wpdb->prefix}wc_reserved_stock",
		"{$wpdb->prefix}wc_rate_limits",
		wc_get_container()->get( DataRegenerator::class )->get_lookup_table_name(),

		// WCA Tables.
		"{$wpdb->prefix}wc_order_stats",
		"{$wpdb->prefix}wc_order_product_lookup",
		"{$wpdb->prefix}wc_order_tax_lookup",
		"{$wpdb->prefix}wc_order_coupon_lookup",
		"{$wpdb->prefix}wc_admin_notes",
		"{$wpdb->prefix}wc_admin_note_actions",
		"{$wpdb->prefix}wc_customer_lookup",
		"{$wpdb->prefix}wc_category_lookup",
	);

	/**
	 * Filter the list of known WooCommerce tables.
	 *
	 * If WooCommerce plugins need to add new tables, they can inject them here.
	 *
	 * @param array $tables An array of WooCommerce-specific database table names.
	 * @since 3.4.0
	 */
	$tables = apply_filters( 'woocommerce_install_get_tables', $tables );

	return $tables;
}