How to disable javascript and CSS
-
This is a response to this post about disabling scripts in Event Manager: http://wordpress.org/support/topic/plugin-events-manager-how-to-disable-scripts
With this function I was able to remove jQuery UI from the front and keep the base events-manager.js as well as the inline code which handles Ajax form submit etc.
In this example, CSS files are also removed. Simply delete
wp_dequeue_style
if you wish to keep them.add_action('init', 'em_enqueue_fix', 20); function em_enqueue_fix() { if(!is_admin()) { wp_dequeue_style('events-manager', plugins_url('events-manager/includes/css/events_manager.css')); wp_dequeue_script('events-manager'); $eventsScripts = array( 'jquery-ui-draggable', 'jquery-ui-position', 'jquery-ui-widget', 'jquery-ui-core', 'jquery-ui-mouse', 'jquery-ui-sortable', 'jquery-ui-datepicker', 'jquery-ui-autocomplete', 'jquery-ui-resizable', 'jquery-ui-button', 'jquery-ui-dialogue' ); wp_dequeue_script( $eventsScripts ); wp_deregister_script( $eventsScripts ); wp_enqueue_script('events-manager', plugins_url('events-manager/includes/js/events-manager.js'), 'jquery'); } }
- The topic ‘How to disable javascript and CSS’ is closed to new replies.