This filter can be used to prevent the Caldera Forms BrainTree add-on from loading its dependencies, including the BrainTree PHP SDK. Please be careful with this hook as it can break Caldera Forms submissions since the BrainTree add-on requires the BrainTree PHP SDK loaded. This hook exists to prevent conflicts with other plugins, such as the BrainTree gateway for WooCommerce.
This filter was added in Caldera Forms BrainTree 1.2.2
Disable Loading Of BrainTree PHP SDK By Caldera Forms
To prevent the loading of Caldera Forms BrainTree’s copy of the BrainTree PHP SDK, just return false on this filter. Only do this if you know that the PHP SDK will be loaded some other way.
Using WooCommerce BrainTree With Caldera Forms BrainTree
This filter was added to resolve a potential conflict with the WooCommerce PayPal Powered by Braintree Payment Gateway. This code example prevents loading of Caldera Forms BrainTree PHP SDK, and then during Caldera Forms submissions ensures that WooCommerce’s copy of the SDK is loaded.
Where Does This Code Go?
When using WordPress hooks to customize Caldera Forms or other plugins you should not modify the plugin files, or you will lose your changes when you update the plugin. Instead you should create a small plugin to hold the custom code. It's easy, learn how here.
Technically you can add the custom code to your theme's functions.php, but then you will not be able to change your theme and keep these customizations.