Skip to content

Instantly share code, notes, and snippets.

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 jonahcoyote/f3dec99098252bf893b17de762bfbd5b to your computer and use it in GitHub Desktop.
Save jonahcoyote/f3dec99098252bf893b17de762bfbd5b to your computer and use it in GitHub Desktop.
Remove Default Tribe Photo View JS & Isotope in Shortcode #tribe #ecp
<?php
/**
* Unenqueue Tribe Scripts and replace with custom ones
*
* Tested with Events Calendar PRO 4.4.22
*/
// Unload isotope and photo view js for shortcode
add_action( 'tribe_events_pro_tribe_events_shortcode_prepare_photo', function() {
// Dequeue ECP's copy of isotope
wp_dequeue_script( 'tribe-events-pro-isotope' );
// Dequeue and deregister ECP's photo view JS
wp_dequeue_script( 'tribe-events-pro-photo' );
wp_deregister_script( 'tribe-events-pro-photo' );
// Enqueue custom scripts
wp_enqueue_script('customisotope', get_stylesheet_directory_uri().'/js/isotope/isotope.pkgd.min.js');
wp_enqueue_script('custom-events-pro-photo', get_stylesheet_directory_uri().'/js/isotope/tribe-events-photo-view.min.js');
}, 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment