Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active September 16, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/4548b955e109540a775389b066299eb4 to your computer and use it in GitHub Desktop.
Save Pebblo/4548b955e109540a775389b066299eb4 to your computer and use it in GitHub Desktop.
Example of how to replace the v3 version of Stripe JS loaded by EE with v2 on a specific page.
<?php
function tw_ee_load_replace_stripe_js_with_v2(){
if( is_page('update-credit-card') ) {
wp_deregister_script('stripe_js');
wp_register_script('stripe_js', 'https://js.stripe.com/v2/', [], '2');
}
}
add_action('wp_enqueue_scripts', 'tw_ee_load_replace_stripe_js_with_v2', 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment