Hi, I recently watch the screencast on gulp/bower and was trying to remove some plugin assets as shown in the screencast, but it simply didn’t work for me, I’m not sure what I’m missing.
I wanted to remove some of the assets from the eventOn plugin and following the screencast added this to my extras.php
You can’t pass the same handle eventOn every time and expect anything to happen. Your comments with the path to each file are ignored since they’re comments.
You need to go into the plugin and get the actual handle of each file being enqueued. You may also need to set a higher priority to that action to make sure it is run after eventOn has enqueued it’s files
…is the handle of the hook used to enqueue the stylesheet defined in the function that was used to register that file.
However, it also appears that many of the scripts/styles in EventOn have been included in arrays, with variables, so whatever you do may break all kinds of things…
Have you tried contacting the EventOn developers for help?
Wish I could make it work even enough to break something haha, but still getting no result, I can’t tell if I’m still just using the wrong handle, but it looks right.
I can get it to work with the Roots Share Buttons. So it may be a case of me contacting the plugin dev I suppose, unless anyone else can tell me another way to find the handles?
Solved it in the end. According to the plugin author of EventOn the classes are under “eventon/includes/class-frontend.php”, however to save other people the trouble of searching for every script/style in every plugin was able to find a plugin which can find them for you - minqueue - it hasn’t been updated for a while, but it works like a charm.
EDIT I only use the minqueue plugin to identify styles & scripts enqueued on a page Not to concatenate & minify them, Sage already allows you to concat and minify styles/scripts by default. (Just a little disclaimer. Also thanks @ben for pulling me up on that I should have explained that originally)
I’m not actually using minqueue to concat or minify anything, I am doing that via sage. I’m only using minqueue to easily identify all the styles and scripts that are being loaded on the page and the class I need to use to dequeue them, which saves me from hunting through the plugin includes as the structure tends to vary a little from plugin to plugin.
The problem I had with EventOn was while I could dequeue all of the styles, it seemed like the only way to dequeue some of the js would be to edit the plugin, at least according to the plugin author. I didn’t want to do that because of updates, so in the end I’ve just used ACF to handle events.
I do like the EventOn plugin though so if you know how to properly dequeue all the scripts without editing the plugin, it would be awesome to know.
Also @benword if you know any wizardry to finding the right class names for enqueued styles/scripts without using a plugin, could you share please?
Also, I’m not sure if this helps, but I found the functions used to enqueue scripts/styles in a plugin I’m using by searching the plugin directory for wp_enqueue_scripts. I hope that helps!