• Resolved heytricia

    (@tendigit)


    I use your plugin with my own styling and script. With the latest upgrades the option to use my own CSS is broken. Plus dequeued script is now included in the page code. I see a partial response to this in another thread, but I want to disable css and scripts via my functions file as so:

    wp_dequeue_script(‘hoverIntent’);
    wp_dequeue_script(‘megamenu’);
    wp_dequeue_style(‘megamenu’);

    I would also like to disable the “flush cache” nags that come up after each update. We’re not using the plugin css, so I’m thinking we shouldn’t have to flush it.

    What do I need to add to my functions file to make all of this work?

    Thanks!

    https://wordpress.org/plugins/megamenu/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same issue here. Inline css for the plugin is being generated after the recent update, even when I have selected “Don’t output CSS” in the General Settings.

    It’s a local site, so no link to the site is available. I’m running WP 4.4.2.

    Plugin Author megamenu

    (@megamenu)

    Hi Both,

    I’ve just released 2.1.2 which includes a fix for “Don’t Output CSS”, please try updating and let me know how it goes.

    Tricia, I’ll get back to you tomorrow about dequeueing those scripts (it’s getting pretty late here and it’s been a long day). In the mean time you might be able to modify the code at the bottom of this page: https://www.maxmegamenu.com/documentation/pro-features/google-fonts/

    The flush cache nag will be totally removed in a future release.

    Regards,
    Tom

    Thread Starter heytricia

    (@tendigit)

    The update did fix the CSS issue. Thanks much!

    Get some brain-rest… looking forward to hearing back from you upon recovery. 😉

    – T

    I can also confirm the recent update fixed the CSS issue. Thank you for your quick response!

    Plugin Author megamenu

    (@megamenu)

    Hooty, thanks for the review – much appreciated! 🙂

    Tricia, please can you try adding this to your themes functions.php file?

    function megamenu_dequeue_scripts() {
       wp_dequeue_script( 'megamenu' );
       wp_dequeue_script( 'hoverIntent' );
    }
    add_action( 'wp_enqueue_scripts', 'megamenu_dequeue_scripts', 9999 );
    
    function megamenu_dequeue_styles() {
       wp_dequeue_style( 'dashicons' );
    }
    add_action( 'megamenu_enqueue_public_scripts', 'megamenu_dequeue_styles', 9999 );

    Note: if you’re logged in as an admin then dashicons will be automatically re-enqueued (for the icons on the admin bar)

    Regards,
    Tom

    Thread Starter heytricia

    (@tendigit)

    Worked perfectly. Thanks so much!

    – Tricia

    Plugin Author megamenu

    (@megamenu)

    You’re welcome & thanks for the review! 🙂

    Regards,
    Tom

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Dequeue styles, scripts and some actions’ is closed to new replies.