I'm new to WP dev and I want to add my own CSS/JS to an existing plugin via an extension that runs after the plugin has loaded (e.g. do_action('plugins_loaded')
). This plugin did not have a payment system integrated, so I'd like to integrate the Braintree API. The payment form requires me to use their JS to submit payment info to their servers. However, should I simply use wp_enqueue_script
in the __construct
part of my extension plugin's main class to add the Braintree JS code and leave it like that? Or should I enqueue specifically in a certain place and then dequeue it?
TL;DR - When using JS from a payment processing company, should they be enqueued then dequeued?