Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@kimcoleman kimcoleman commented Oct 1, 2020

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