Last active
July 2, 2022 03:20
-
-
Save dreadedhamish/671ca6a875df1cc60a5f46a67288408a to your computer and use it in GitHub Desktop.
Conditionally load Timetable scripts and styles
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
// Conditional loading of scripts and styles for "Timetable Responsive Schedule For WordPress" by Quantica Labs | |
// https://quanticalabs.com/home/portfolio/timetable-responsive-schedule-for-wordpress/ | |
// https://codecanyon.net/item/timetable-responsive-schedule-for-wordpress/7010836 | |
// Your mileage may vary depending on what functionality you're using. | |
// add to your themes functions.php file. | |
// works as of v7 | |
function remove_timetable() { | |
global $post; | |
if( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'tt_timetable') ) { | |
wp_dequeue_script( 'jquery-ba-bqq' ); | |
wp_dequeue_script( 'jquery-qtip2' ); | |
wp_dequeue_script( 'timetable_main' ); | |
wp_dequeue_script( 'jquery-carouFredSel' ); | |
wp_dequeue_style( 'timetable_responsive_stylee' ); | |
wp_dequeue_style( 'timetable_sf_style' ); | |
wp_dequeue_style( 'timetable_gtip2_style' ); | |
wp_dequeue_style( 'timetable_style' ); | |
wp_dequeue_style( 'timetable_event_template' ); | |
wp_dequeue_style( 'timetable_responsive_style' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'remove_timetable', 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment