Skip to main content
added 95 characters in body
Source Link

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?

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?

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?

Source Link

Should I be enqueueing styles/scripts once and then dequeueing them?

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?