Gutenberg needs the theme.json in wp-includes to generate a CSS which gives styles for the editor. Without such styles the Editor might be not usable.
If you want to override settings you have to add a custom theme.json in your theme-directory. Again: it is not possible to disable this.
Here you’ll find more infos about the file: https://mkaz.blog/wordpress/using-theme-json-in-a-classic-theme/
Thanks that exactly what I needed. The default null settings has done the trick
{
"version": 2,
"settings": {
"color": {
"duotone": null,
"palette": null,
"gradients": null
},
"typography": {
"fontSizes": null
}
},
"styles": null,
"variables": null,
"presets": null
}
If you know is there any possibility to disable transients for these settings also? As I can see, when calling global styles, WordPress first delete and then set settings from theme.json
into transients called _transient_global_styles_theme_name
and _transient_timeout_global_styles_theme_name
. That extra 4 slow queries. With setting above, I just set empty string as a transient. The only things I can see which may disable it are WP_DEBUG === true
or SCRIPT_DEBUG === true
or REST_REQUEST === true
(file wp-includes/global-styles-and-settings.php line 88
). But it is a production mode so WP_DEBUG
is set to false
. I tried to disable global styles registration but no luck so far
Sort of thinking out loud on the disabling the transient, could maybe hook to the filter?
https://github.com/WordPress/WordPress/blob/4cbad9a9aa655f6a1430887c3bd0732550e6d3f8/wp-includes/option.php#L843
add_filter('pre_transient_global_styles_theme_name', '__return_true', 10 );
-
This reply was modified 2 years, 8 months ago by Jose Castaneda. Reason: use correct function name
Yes this filter worked thanks a lot)
Yay!
Glad to hear that works. I went spelunking on the code trying to recall what the hook was called for the transients.
my website is creating issue suggest me theme