diff --git a/gateway-payfast.php b/gateway-payfast.php index 5e835a4..a980955 100644 --- a/gateway-payfast.php +++ b/gateway-payfast.php @@ -12,7 +12,6 @@ * WC requires at least: 8.1 * Requires PHP: 7.3 */ -use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry; defined( 'ABSPATH' ) || exit; @@ -81,16 +80,29 @@ function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_ } /** - * Declares support for HPOS. + * Declares compatibility with Woocommerce features. * + * List of features: + * - custom_order_tables + * - product_block_editor + * + * @since x.x.x Rename function * @return void */ -function woocommerce_payfast_declare_hpos_compatibility() { - if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); +function woocommerce_payfast_declare_feature_compatibility() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( + 'custom_order_tables', + __FILE__ + ); + + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( + 'product_block_editor', + __FILE__ + ); } } -add_action( 'before_woocommerce_init', 'woocommerce_payfast_declare_hpos_compatibility' ); +add_action( 'before_woocommerce_init', 'woocommerce_payfast_declare_feature_compatibility' ); /** * Display notice if WooCommerce is not installed.