dequeuing ajax event calendar scripts
-
I wonder if you could help me with the Ajax Events Calendar? I’m running wordpress 4.2.2 and I’m currently using this plugin v 1.04. I’m attempting to dequeue the scripts on pages for which it is not required, using the following in functions.php:
/** *Ajax event calendar plugin: Cleanup global scripts when not required */ add_action( 'wp_enqueue_scripts', 'AEC_cleanup' ); function AEC_cleanup() { /** Dequeue globally enqueued styles & scripts*/ wp_dequeue_script( 'jquery' ); wp_dequeue_script( 'fullcalendar' ); wp_dequeue_script( 'simplemodal' ); wp_dequeue_script( 'mousewheel' ); wp_dequeue_script( 'growl' ); wp_dequeue_script( 'jquery-ui-datepicker' ); wp_dequeue_script( 'init_show_calendar' ); if ( is_page( '245' ) ) { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'fullcalendar' ); wp_enqueue_script( 'simplemodal' ); wp_enqueue_script( 'mousewheel' ); wp_enqueue_script( 'growl' ); wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_script( 'init_show_calendar' ); } // end if } // end function AEC Cleanup
This normally works in wordpress, however, I’m finding that the scripts are loaded across all pages despite attempting to dequeue site wide except for page id 254. Is there something fundamental that I’m missing here?
- The topic ‘dequeuing ajax event calendar scripts’ is closed to new replies.