Forked from barryhughes/temp-fix-ecp-embedded-photo-view-avada.php
Last active
April 9, 2018 17:07
-
-
Save jonahcoyote/f3dec99098252bf893b17de762bfbd5b to your computer and use it in GitHub Desktop.
Remove Default Tribe Photo View JS & Isotope in Shortcode #tribe #ecp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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