WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] How to disable javascript and CSS (1 post)

  1. Sebastien Couture
    Member
    Posted 1 year ago #

    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');
    
    	}
    }

    http://wordpress.org/extend/plugins/events-manager/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic