From cefa627e385285e548ef4f900ff3ac18095eea91 Mon Sep 17 00:00:00 2001 From: Sebastian Pisula <sebastian.pisula@gmail.com> Date: Tue, 22 Nov 2022 23:12:30 +0100 Subject: [PATCH] feature(core): Added Compatibility with WooCommerce High-Performance Order Storage (HPOS) --- CHANGELOG.md | 4 ++++ lang/.gitignore | 4 ---- src/PluginBootstrap.php | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) delete mode 100644 lang/.gitignore diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d79b2c..b7ce6fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.1.0] - 2022-11-23 +### Added +- Compatibility with WooCommerce High-Performance Order Storage (HPOS) + ## [1.0.4] - 2022-05-25 ### Fixed - Added missing `wpdesk/wp-wpdesk-tracker` library diff --git a/lang/.gitignore b/lang/.gitignore deleted file mode 100644 index 06e1972..0000000 --- a/lang/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!.gitignore -!pl_PL.po -!index.php \ No newline at end of file diff --git a/src/PluginBootstrap.php b/src/PluginBootstrap.php index 521bceb..247dd58 100644 --- a/src/PluginBootstrap.php +++ b/src/PluginBootstrap.php @@ -115,6 +115,16 @@ final class PluginBootstrap { }, self::PRIORITY_BEFORE_FLOW_2_5 ); + + add_action( + 'before_woocommerce_init', + static function () use ( $plugin_info ) { + $features_util_class = '\\' . 'Automattic' . '\\' . 'WooCommerce' . '\\' . 'Utilities' . '\\' . 'FeaturesUtil'; + if ( class_exists( $features_util_class ) ) { + $features_util_class::declare_compatibility( 'custom_order_tables', $plugin_info->get_plugin_file_name(), true ); + } + } + ); } /** -- GitLab