-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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