eventsmanager

Disable Stripe.js on non-event pages

Jul 27th, 2020
1,547
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. This script will disable stripe from loading its JS file on every page on your site,
  4. apart from event pages and page with ID 123. Edit 123 to your desired page.
  5. To just load this on event pages, remove 'is_page(123) ||' from the code below.
  6.  
  7. For installation instructions see here - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  8. */
  9. add_action('wp_enqueue_scripts', function(){
  10.     if( !(is_page(123) || em_is_event_page()) ){
  11.         wp_dequeue_script('stripe-v3');
  12.     }
  13. }, 100);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×