Skip to content

Instantly share code, notes, and snippets.

@tharlab
Forked from xlplugins/WFACP_ReCaptcha_For_WC
Created December 21, 2023 06:04
Show Gist options
  • Save tharlab/a2c018cc5f95476bc119db4a4ccc9c8b to your computer and use it in GitHub Desktop.
Save tharlab/a2c018cc5f95476bc119db4a4ccc9c8b to your computer and use it in GitHub Desktop.
Funnelkit Checkout comptability added with ReCaptcha For WC by Thirteen Web Solution
class WFACP_ReCaptcha_For_WC {
private $instance = null;
public function __construct() {
add_action( 'wfacp_template_load', [ $this, 'actions' ] );
}
public function is_enable() {
return class_exists( 'I13_Woo_Recpatcha' );
}
public function actions() {
if ( ! $this->is_enable() ) {
return;
}
$this->instance = WFACP_Common::remove_actions( 'woocommerce_review_order_before_submit', 'I13_Woo_Recpatcha', 'i13woo_extra_checkout_fields' );
if ( $this->instance instanceof I13_Woo_Recpatcha ) {
add_action( 'wfacp_woocommerce_review_order_before_submit', [ $this->instance, 'i13woo_extra_checkout_fields' ] );
}
}
}
new WFACP_ReCaptcha_For_WC();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment