Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created June 2, 2021 13:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/fec9ba9c123186500c4e2940313bb680 to your computer and use it in GitHub Desktop.
Save Pebblo/fec9ba9c123186500c4e2940313bb680 to your computer and use it in GitHub Desktop.
Example of how to dequeue the Stripe JS file on all pages except the 'registration-checkout' page.
<?php //Please do not include the opening PHP tag if you already have one
add_action( 'wp_enqueue_scripts', 'tw_ee_dequeue_stripe_js', 20 );
function tw_ee_dequeue_stripe_js() {
if(! is_page('registration-checkout')) {
wp_dequeue_script( 'stripe_js' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment