'plugin-information', 'plugin' => 'woocommerce', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500', ), admin_url( 'plugin-install.php' ) ); $message = __( "reCaptcha for WooCommerce is an add-on of ", "recaptcha-for-woocommerce" ); printf( '

%2$s %4$s

', 'notice notice-error', wp_kses_post( $message ), esc_url( $link ), esc_html__( 'WooCommerce', 'recaptcha-for-woocommerce' ) ); } } add_action( 'admin_notices', 'wc_recaptcha_for_woocommerce_wc_requirement_notice' ); /** * Returns the main instance */ function wc_recaptcha_for_woocommerce() { if ( ! class_exists( 'WooCommerce', false ) ) { return false; } return WC_Recaptcha_For_WooCommerce::instance(); } add_action( 'plugins_loaded', 'wc_recaptcha_for_woocommerce' ); /** * HPOS Compatibility */ function wc_recaptcha_for_woocommerce_hpos_compatibility() { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); } } add_action( 'before_woocommerce_init', 'wc_recaptcha_for_woocommerce_hpos_compatibility' );