From 040e51b563dca23f105836c7f4b45279bd0403d9 Mon Sep 17 00:00:00 2001 From: mattallan Date: Mon, 21 Aug 2023 12:16:21 +1000 Subject: [PATCH] Declare support for HPOS --- wcs-importer-exporter.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wcs-importer-exporter.php b/wcs-importer-exporter.php index ad57144..86002e1 100644 --- a/wcs-importer-exporter.php +++ b/wcs-importer-exporter.php @@ -41,6 +41,18 @@ require_once( 'woo-includes/woo-functions.php' ); } +/** + * Declare plugin compatibility with WooCommerce HPOS. + */ +add_action( + 'before_woocommerce_init', + function() { + if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); + } + } +); + require_once( 'includes/wcsi-functions.php' ); class WCS_Importer_Exporter {