Add core update hook to clear global styles stylesheet#2
Add core update hook to clear global styles stylesheet#2ironprogrammer wants to merge 2 commits into
Conversation
|
@azaozz and @anton-vlasenko, after some additional discussion with @costdev, I’ve created this PR, which updates the test plugin with a proposed “permanent” function that could ship with core. The plugin now accounts for two things:
|
|
Hmm, why use this in core? Thinking the removal of the transient as in WordPress/wordpress-develop#3712 is a better solution. It's just hard to do the same from a plugin. (A transient that is updated every minute is a pretty bad idea. On sites without persistent caching this can write to the DB every minute (from the front-end) causing slow-downs and inefficient use of resources. On some low-powered hosting accounts that may even exceed the usage limits and "lock" the db and the site.) Also, even if a function has to be added to core, think it is a bad idea to not follow the plugins rules and not prefix it. What purpose would be served by naming the plugin's function with the expected name for core and then having to use |
|
Thanks for the feedback, @azaozz! We'll hold on this PR pending input on the original version (that doesn't clear the transient on every upgrade). I agree that as a long term solution, it would be better to go with the backports provided in WordPress/wordpress-develop#3712. Hopefully it resolves the issue for reporters 🤞🏻 |
|
Closing since the original cache invalidation approach in WordPress/wordpress-develop#3712 has been merged in r55148 (Trac 56910). |
Adds function to delete the global styles stylesheet transient on core update.
Tested on upgrades from 5.9.5/6.0.3 to 6.1.1.