• Resolved mattgerrish

    (@mattgerrish)


    Hi,

    I like to dequeue the plugin styles as I don’t need 3 stylesheets called.

    I’ve tried the following in functions.php but it doesn’t work:

    add_action(‘wp_enqueue_scripts’, ‘dequeue_glossary_plugin_style’, 100);
    function dequeue_glossary_plugin_style(){
    wp_dequeue_style(‘glossary-general-css’);
    wp_dequeue_style(‘glossary-hint-css’);
    wp_dequeue_style(‘glossary-mobile-tooltip-css’);
    }

    Any pointers much appreciated.

    Thanks,
    Matt

Viewing 15 replies - 1 through 15 (of 18 total)
  • You don’t need the suffix -css as this is added by wordpress itself, also our priority is 9999 for those files so you need for the filter a value more high then 100 as your snippet.

    Thread Starter mattgerrish

    (@mattgerrish)

    Hi Daniele, thanks for your response.

    So what would the actual snippet be then? I’m used to just dequeueing shortcodes…

    add_action(‘wp_enqueue_scripts’, ‘dequeue_glossary_plugin_style’, 99999);
    function dequeue_glossary_plugin_style(){
    wp_dequeue_style(‘glossary-general’);
    wp_dequeue_style(‘glossary-hint’);
    wp_dequeue_style(‘glossary-mobile-tooltip’);
    }

    This should be enough to dequeue those files. Anyway the mobile-tooltip is a premium feature so you are a premium user and you cloud use https://support.codeat.co but this file is added by an option in the settings so if you don’t need you can disable it.

    The general is for the widgets and hint is for the tooltip itself. If you are not using the tooltip mode for links it won’t be added in your page.

    I think that I can implement an internal check to not load general css if there are no glossary widget in use.

    Thread Starter mattgerrish

    (@mattgerrish)

    Hi Daniele,
    That’s great, thank you.

    The only css file that is still showing is ‘glossary-general-css’.

    How do I dequeue that as well?

    We would prefer to minimize the css requests if possible.

    Thanks,
    Matt

    The next release I will do next week will not enqueue that file in the page if there are no Glossary widgets. I already started working on that.

    Thread Starter mattgerrish

    (@mattgerrish)

    Ok lovely thanks for that Daniele. Love your plugin, keep up the good work ??

    I am releasing now the version with that enhancement, so just check on your wordpress dashboard in the next hours for an update.

    Thread Starter mattgerrish

    (@mattgerrish)

    Hi Daniele,
    Did you release the enhancement? If so, how do I dequeue the general css file?
    I tried this, but it doesn’t work:
    wp_dequeue_style(‘glossary-general’’);
    Thanks,
    Matt

    Yes the latest release has the code to not inject that file if the widget are not used.

    Thread Starter mattgerrish

    (@mattgerrish)

    Is that 2.0.10?

    Thread Starter mattgerrish

    (@mattgerrish)

    where can I download the latest release?

    You can download/update it from the wordpress dashboard as you have installed the plugin inside.

    Thread Starter mattgerrish

    (@mattgerrish)

    it might be because i have the premium plugin.. it doesnt show an update available

    That version is available also for premium users. Can you check the version that you have installed in the plugin page of your wordpress backend?

    Thread Starter mattgerrish

    (@mattgerrish)

    2.0.10 – there is no option to update

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘dequeue css’ is closed to new replies.