WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] EM Loadings Lots of Scripts to wp_head() (5 posts)

  1. James Mehorter
    Member
    Posted 1 year ago #

    Hello, We're using the list feature of Events Manager, and noticed that wp_head() outputs 13 javascript files, 1 css files, and one script tag with javascript variables all from Events Manager. Most of the scripts are for jQuery UI. Given that we're using the list view of EM, we don't need these scripts and they are just adding to the page load/download time. How can we disable these scripts / force them not to display? Does EM have a DONT_PRINT_SCRIPTS constant similar to NextGen Gallery? We don't want EM to output anything to wp_head().

    Thanks!

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

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    We don't but you can use wp_dequeue_scripts to prevent any scripts from loading, or alternatively, you'd use this

    function my_em_scripts_function(){
      remove_action('init', array('EM_Scripts_and_Styles','public_enqueue'));
    }
    add_action('init','my_em_scripts_function',1000);
  3. James Mehorter
    Member
    Posted 1 year ago #

    Hi Marcus, thanks. Does that need to be customized at all? I just dropped that code in my functions.php and none of the EM scripts/styles are disappearing from the source. Thanks for your help with this!

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    i wrote this by hand, but in theory that should work.

    you may need to dig into this and play around with the above - events-manager.php - line 172

  5. macemmek
    Member
    Posted 1 year ago #

    Sorry for late input into resolved topic but I had this problem, came here and found a missing element.

    function my_em_scripts_function(){
      remove_action('wp_enqueue_scripts', array('EM_Scripts_and_Styles','public_enqueue'));
    }
    add_action('init','my_em_scripts_function',1000);

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic