<?php
/**
 * Compatibility declarations for third-party platforms.
 *
 * @package ZubairRay_Connect_Buttons
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Registers compatibility signals for supported WordPress tooling.
 */
class ZRCB_Compatibility {

	/**
	 * Hook compatibility declarations.
	 */
	public static function init() {
		add_action( 'before_woocommerce_init', array( __CLASS__, 'declare_woocommerce_compatibility' ) );
	}

	/**
	 * Declare WooCommerce feature compatibility when WooCommerce is active.
	 */
	public static function declare_woocommerce_compatibility() {
		if ( ! class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
			return;
		}

		\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', ZRCB_PLUGIN_FILE, true );
		\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', ZRCB_PLUGIN_FILE, true );
	}
}
