#59863 closed defect (bug) (reported-upstream)
Hundreds of fonts loaded via wp-fonts-local on front-end and dashboard
Reported by: | rghedin | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.4 |
Component: | General | Keywords: | close |
Focuses: | Cc: |
Description
After upgrading to 6.4 (issue remains in 6.4.1), my site started loading tons (+600) fonts on both front-end and admin dashboard.
They are loaded on <head>
, via an inline style tag with wp-fonts-local
class, summoning fonts with @font-face.
I switched themes and the issue remains regardless.
Was able to avoid loading all these fonts with this code in functions.php
:
remove_action( 'wp_head', 'wp_print_font_faces', 50 );
It's possible to witness it right now in my staging site: https://staging-02d9-rghedin.wpcomstaging.com
Change History (6)
#2
@
11 months ago
- Keywords reporter-feedback added
Welcome to trac @rghedin.
When I checked this with twentytwentyfour, it loads 4 fonts, not hundreds. Looking through the code of the font loader, this is based off global settings which are largely a result of the theme.json.
You mention having tried this on multiple themes, can you link the theme.json for each of these? Do you have any plugins that would be modifying it?
#3
@
11 months ago
Sure, @jorbin
Here's from TT4: https://staging-02d9-rghedin.wpcomstaging.com/wp-content/themes/twentytwentyfour/theme.json
Here's from my custom theme (per theme.json
, it shouldn't load any font whatsoever): https://staging-02d9-rghedin.wpcomstaging.com/wp-content/themes/dez/theme.json
I'm afraid this may be an issue specific of wordpress.com, though.
#4
follow-up:
↓ 5
@
11 months ago
Looking at the font list, it might be Jetpack.
https://github.com/Automattic/jetpack/blob/f10623324ce21823f76fcdc5a007c532036863b5/projects/plugins/jetpack/modules/google-fonts/wordpress-6.3/constants.php#L12
https://github.com/Automattic/jetpack/blob/9ac2c57b1d109532f83cefd421b8749e3f40c486/projects/plugins/jetpack/modules/google-fonts/current/load-google-fonts.php#L103-L149
Thanks for your ticket @rghedin. This was introduced in: https://core.trac.wordpress.org/ticket/59165
As per the ticket, "Once called, it gets the fonts from Theme_JSON merged data layer, which includes theme defined fonts and user activated fonts (once the Font Library #59166 is introduced into Core)."
Maybe @hellofromTonya can add more context here, but seemingly it's an intentional behavior.