update_meta_data()), never * through post meta directly, so it is genuinely compatible — this just says so. */ add_action( 'before_woocommerce_init', function () { if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', AFFCLIX_WC_FILE, true); \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', AFFCLIX_WC_FILE, true); } } ); /** * Boot, but only once WooCommerce is actually present. * * Activating this on a site without WooCommerce must not fatal — WordPress * would leave the site white-screened with no way back in through the admin. */ add_action( 'plugins_loaded', function () { if (! class_exists('WooCommerce')) { add_action( 'admin_notices', function () { echo '
'; esc_html_e('AffClix for WooCommerce needs WooCommerce to be installed and active.', 'affclix-for-woocommerce'); echo '