-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to cache the theme json file reading #3401
Try to cache the theme json file reading #3401
Conversation
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); | ||
$theme_json_data = $theme_json->get_data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set static::$theme_json_data
after these two lines. Then the theme json file does not apply.
static::$theme_json_data = $theme_json_data; | ||
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); | ||
$theme_json_data = $theme_json->get_data(); | ||
static::$theme = new WP_Theme_JSON( $theme_json_data ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should test it with child themes.
cc/ @oandregal, would this approach be correct? |
00b8099
to
4f69396
Compare
Rebased. |
4f69396
to
e2704ab
Compare
I think this is working now 🎉 I was about to implement file caching for the parent theme (see #3401 (comment)), but then it occurred to me that we might solve this slightly differently: We can add a single I'll give that a try. |
#3408 does the work, so we can close this one. |
Try to fix #44619
Testing instructions:
WordPress/gutenberg#44619 (comment)
Not working yet 😢
Trac ticket: https://core.trac.wordpress.org/ticket/56736