Support » Plugin: Events Manager » How to disable javascript and CSS

  • This is a response to this post about disabling scripts in Event Manager:

    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'));
    		$eventsScripts = array(
    		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.