Created
October 1, 2020 15:14
-
-
Save kimcoleman/6a678b8c4b4f09aecd2f212f37e2d483 to your computer and use it in GitHub Desktop.
Remove a specific Stripe JavaScript library from loading on the checkout page. This recipe removes the library loaded by the Charitable plugin.
This file contains hidden or 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 | |
/* | |
* Remove a specific Stripe JavaScript library from loading on the checkout page. | |
* This recipe removes the library loaded by the Charitable plugin. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function stop_other_stripe_js_loading_on_checkout() { | |
if ( isset( $_REQUEST['level'] ) ) { | |
remove_action( 'plugins_loaded', 'charitable_stripe_load', 1 ); | |
} | |
} | |
add_action('plugins_loaded', 'stop_other_stripe_js_loading_on_checkout', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more information on this recipe and related issues, see this troubleshooting guide: https://www.paidmembershipspro.com/troubleshooting-issues-at-checkout-when-using-stripe/