Support » Plugin: JQuery Mega Menu Widget » [Plugin: JQuery Mega Menu Widget] WP_enqueue_script was called incorrectly

  • Resolved syndrael

    (@syndrael)


    Hello,
    I’m under WP3.3.2 and i’ve tried to install jqMegaMenu 1.3.8
    With the options below in my wp-config.php file i get this error.
    define(‘WP_DEBUG’, true);
    // Enable Debug logging to the /wp-content/debug.log file
    define(‘WP_DEBUG_LOG’, true);
    // Disable display of errors and warnings
    define(‘WP_DEBUG_DISPLAY’, true);

    Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in E:\www\wp_pure\wordpress\wp-includes\functions.php on line 3587

    In my mind it’s due to the constructor in the plugin after the first wp_enqueue_script:
    // Header styles
    add_action( ‘wp_head’, array(‘dc_jqmegamenu’, ‘header’) );
    // Scripts
    wp_enqueue_script( ‘jquery’ );
    wp_enqueue_script( ‘jqueryhoverintent’, dc_jqmegamenu::get_plugin_directory() . ‘/js/jquery.hoverIntent.minified.js’, array(‘jquery’) );
    wp_enqueue_script( ‘dcjqmegamenu’, dc_jqmegamenu::get_plugin_directory() . ‘/js/jquery.dcmegamenu.1.3.4.min.js’, array(‘jquery’) );

    Could you correct it ?
    Is it possible to register jquery for the footer ?
    Best regards from PAris,France
    S.

    http://wordpress.org/extend/plugins/jquery-mega-menu/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author remix4

    (@remix4)

    Thanks for the info and will look at updating in the next update.

    In the meantime though this is only a “Notice” and will not affect how the plugin operates

    In the meantime though this is only a “Notice” and will not affect how the plugin operates

    That’s correct but i like clean code.. LOL.
    In the same time, could you modify the code in order to make possible to put jquery in footer.
    Before your plugin, my Jquery was queued in the footer but because your dynamic jquery javascript, jQuery must be queued in the header.
    Best regards
    S.

    I’ve posted a patch here

    Thank you, but it’s too late. I’ve changed this plugin.
    I hope it will be helpful for somebody else..
    Best regards
    S.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: JQuery Mega Menu Widget] WP_enqueue_script was called incorrectly’ is closed to new replies.