Skip to content

Instantly share code, notes, and snippets.

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 kimcoleman/6a678b8c4b4f09aecd2f212f37e2d483 to your computer and use it in GitHub Desktop.
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.
<?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 );
@kimcoleman
Copy link
Author

For more information on this recipe and related issues, see this troubleshooting guide: https://www.paidmembershipspro.com/troubleshooting-issues-at-checkout-when-using-stripe/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment