Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example code for using the cf_brain_tree_load_dependencies to prevent BrainTree SDK conflicts with other plugins including WooCommerce
<?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' );
});
<?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
You can’t perform that action at this time.