From 67f8439cb1e5b01385925a6db02e1b7e90460497 Mon Sep 17 00:00:00 2001 From: Alex Florisca Date: Thu, 13 Oct 2022 15:49:02 +0100 Subject: [PATCH] Update HPOS compatibility snippet (#7395) --- woocommerce-gutenberg-products-block.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php index ef15c4bf1d5..ec372a00872 100644 --- a/woocommerce-gutenberg-products-block.php +++ b/woocommerce-gutenberg-products-block.php @@ -25,14 +25,14 @@ } // Declare compatibility with custom order tables for WooCommerce. -if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { - add_action( - 'before_woocommerce_init', - function () { +add_action( + 'before_woocommerce_init', + function () { + if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); } - ); -} + } +); /** * Whether notices must be displayed in the current page (plugins and WooCommerce pages).