Skip to content

Conversation

@youknowriad
Copy link
Contributor

This PR allows access to the font library for classic themes with theme.json files (sometimes called hybrid themes).

Testing instructions

I've tested on Astra which fits this description but I'd love some testing on this because I don't have much experience with such themes.

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: youknowriad <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: mrleemon <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@youknowriad youknowriad added [Type] Experimental Experimental feature or API. and removed [Type] Enhancement A suggestion for improvement. labels Dec 10, 2025
@github-actions
Copy link

Flaky tests detected in 6e196e4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20098313607
📝 Reported issues:

@mrleemon
Copy link
Contributor

Not sure about replacing if ( ! wp_is_block_theme() ) with if ( ! wp_theme_has_theme_json() ). This is because a theme can be considered a block theme even if it doesn't explicitly include a theme.json file, suggesting the two functions may not be entirely interchangeable for determining theme capabilities.

@t-hamano
Copy link
Contributor

This is because a theme can be considered a block theme even if it doesn't explicitly include a theme.json file

That's right. What if we change the conditional statement to this:

if ( ! wp_is_block_theme() && ! wp_theme_has_theme_json() ) {
	return;
}

I also noticed that the global styles doesnn't work for themes that don't have a theme.json. I think this is because the initial data is only inserted if the theme has a theme.json.

https://github.com/WordPress/wordpress-develop/blob/63b3a8f6c874c8dd7cec0400edf3135ad98f649d/src/wp-includes/class-wp-theme-json-resolver.php#L490

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I also noticed that the global styles doesn't work for themes that don't have a theme.json. I think this is because the initial data is only inserted if the theme has a theme.json.

I have submitted a core ticket regarding this concern: https://core.trac.wordpress.org/ticket/64402

@youknowriad youknowriad merged commit 1744598 into trunk Dec 11, 2025
34 checks passed
@youknowriad youknowriad deleted the add/fonts-hybrid-themes branch December 11, 2025 11:59
@github-actions github-actions bot added this to the Gutenberg 22.4 milestone Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants