Last active
September 7, 2018 15:24
-
-
Save Shelob9/b86c9110f5ef87ce0ad2e51cf7a86a34 to your computer and use it in GitHub Desktop.
Example code for using the cf_brain_tree_load_dependencies to prevent BrainTree SDK conflicts with other plugins including WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If WooCommerce BrainTree is active, use WooCommerce's copy of BrainTree SDK instead of Caldera Forms' | |
* | |
* If using WooCommerce Braintree v1 - use this revision https://gist.github.com/Shelob9/b86c9110f5ef87ce0ad2e51cf7a86a34/revisions | |
*/ | |
add_action( 'init', function(){ | |
if( ! class_exists( 'WC_Braintree' ) ){ | |
return; | |
} | |
/** | |
* Prevent Caldera Forms BrainTree from loading its dependencies, including the BrainTree PHP SDK | |
*/ | |
add_filter( 'cf_brain_tree_load_dependencies', '__return_false' ); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prevent Caldera Forms BrainTree from loading its dependencies, including the BrainTree PHP SDK | |
*/ | |
add_filter( 'cf_brain_tree_load_dependencies', '__return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment