Global Styles: Alternative method for enqueueing custom CSS#47554
Global Styles: Alternative method for enqueueing custom CSS#47554Mamaduka merged 4 commits intoupdate/custom-css-load-orderfrom
Conversation
ded874c to
4e4f9db
Compare
4e4f9db to
0f82606
Compare
|
Flaky tests detected in d552d79. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4053536069
|
|
|
||
| if ( ! wp_theme_has_theme_json() ) { | ||
| return; | ||
| return ''; |
There was a problem hiding this comment.
Need to return empty string here.
|
This tested well for me. The only thing I noticed is that with using A comment was also made here about trying to keep the custom CSS loading in the same location as the customizer CSS - I don't have a strong opinion one way or the other on how critical this is - use of the |
|
Using Let's keep using cc @aristath |
Sounds good to me 👍 |
What?
My alternative to the enqueueing method is proposed at #47396.
Instead of using two separate callbacks for loading custom CSS from Customizer and Site Editor, the new method removes Customzer callback, combines custom CSS values, and enqueues styles after
global-styles.I've also made the following changes to the
get_global_styles_custom_cssmethod:$typesvariable - the function doesn't accept arguments.::get_merged_dataif a theme does not have atheme.jsonfile.Testing Instructions
Please take a look at the instructions in the original PR.