[Fonts API] Relocate which fonts to print from script-loader into wp_print_fonts() #50140
Labels
[Type] Code Quality
Issues or PRs that relate to code quality
[Type] Enhancement
A suggestion for improvement.
When printing fonts for the iframed editor assets, relocate the know-how of which fonts to print into the Fonts API
wp_print_fonts()
function.Why?
For 6.3 compat, a recent change from PR #49655 invokes only
wp_print_fonts()
. This makes sense, as code outside of the API should not have to know the implementation details. That's the job of the API.The code implemented in 6.2 compat needs to be relocated:
Note: The above code is from #49646, which fixes a bug of which fonts to be printed.
In this way, the API's
wp_print_fonts()
is responsible for knowing which fonts to print:Impacts
Fixing #49645 is currently blocked as noted here by #40353. Care is needed on how to relocate the code.
Suggested Plan
I'd suggest the following to avoid the above impacts:
lib/compat/wordpress-6.2/script-loader.php
intowp_print_fonts()
and instead invokewp_print_fonts()
in the script loader.The text was updated successfully, but these errors were encountered: