-
-
Notifications
You must be signed in to change notification settings - Fork 328
Unnecessary CSS loaded in frontend #210
Comments
You must have included these CSS by yourself. Coz I don't recognize these new files. |
Nope. As I said after noticing this I've set up a new blank installation with it's default theme and no other plugins active, just to be sure that it's not my or another plugin's fault. I didn't change anything except the name of the new block. |
These are the three files that create-guten-block enqueues https://github.com/ahmadawais/create-guten-block/blob/master/packages/cgb-scripts/template/src/init.php#L32-L54 Everything else comes from your own setup. Take time to read the links of these scripts and their names. Your theme is putting out these links. Press COMMAND (⌘) + F and search Peace! ✌️ |
I know that these are the only files called by the plugin (first thing I did was looking at init.php), but the other ones get loaded as soon I enable it. I disable it and their gone - so in some way the plugin has an effect on wordpress' register/enqueue functions - doesn't matter if I'm logged in, inkognito mode or whatever.. And as I said (twice): the theme is twentynineteen - nothing changed. Anyway, thanks. |
For anyone stumbling upon this: I found the same issue and investigated it. Turns out, the reason for the additional styles being loaded in the frontend is the dependency to I fixed it by replacing In my opinion this should be reopened and addressed, and I find it curious that the author didn't catch that when presented with this issue. |
Send in a PR and I'll check it. |
See #267 |
This issue must have been solved via #267. Successfully published:
You do have to manually update the init.php file like this. |
Bug Report
Expected Behavior
After creating / enabling my first guten-block plugin I inspected the pages source code to see at which position my frontend stylesheet for the new block gets included. To my surprise there wasn't just one new file but 6 instead.
Actual Behavior
The other 5 stylesheets are for the editor only (at least I think so? correct me if I'm wrong ;)), so they shouldn't be there at all.
Head before enabling the plugin:
Head after enabling:
Steps to Reproduce
I've also tested this on a new WP installation with default theme and no plugins active.
The text was updated successfully, but these errors were encountered: