-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Deleted Webfont Font Families remain available in Global Styles following theme switches #59974
Comments
This Issue was triaged by Editor release leads and contributors in WP Slack as part of the final WordPress 6.5 process. See https://wordpress.slack.com/archives/C02QB2JS7/p1711372016096219 (requires registration). The criteria used was:
Conclusion: we propose that any fix for this Issue is not included in WP 6.5 and is punted to 6.5.1. Contributors recognised that the UX is far from ideal, but without a PR and with the other work required for 6.5 there was no clear route for a shipping a fix in time for the major release. However we should strive to have a robust solution in place for 6.5.1. |
I did some quick investigation of the font-family post types. While testing matiasbenedetto/modern-fonts-stacks-for-font-library and in discussion with @creativecoder via Slack, I confirmed that System font font-families do not have any font-face post types created as they're not required. This is because So when the final font-face child of a font-family post type is removed, it's safe to assume that the font-family is a webfont and can be dropped as well. Some additional logic may be helpful and can be the subject of further discussion. (Circular logic warning: deleting a font-family deletes the font-faces so it will need to be checked for infinite loops.) What I haven't been able to figure out is how to handle the global and block styles that make use of a since removed font-family. Clearly updating all the post objects when a font-family is removed is out of the question so it probably needs some logic on render to confirm the font family is still defined. Once a post object is opened in the site/block editor it could be updated in a fashion similar to deprecation migrations. All the discussion for this can wait, I'm just logging this while I remember some of the testing I did and the gotchas I discovered while doing so. |
See related issue: #58375 |
I think what would be beneficial here is if there is notice of some sort, likely in the site editor as a whole but possibly just in the global styles that the expected font is not installed and ideally a one click fix. It should hopefully be clear to a person who expects one font that the site isn't using that font, but I don't think that is 100% certain so I think a notice of some sort is necessary. While it is a bug, I also think it might be rare to encounter this until the font library have been in place for longer, so I wonder if this might be a better fit for 6.6 than 6.5.x |
Hi folks, |
Description
Deleted webfonts remain available and is use by a theme following a theme switch:
This results in broken styles and the display of affected elements falling back to the default system font.
In such circumstances, I suggest the following:
--wp--preset--font-family--just-another-hand: "Web Font Name", "Theme Font Default", system-default;
Step-by-step reproduction instructions
Convenience steps
wp post delete $(wp post list --post_type='wp_font_face,wp_font_family' --format=ids) --force
cursive
Long form steps
Replace the WP CLI command with:
Following the reproduction steps you may be able to reinstall the Google Font and everything will look nice again. In production this is unlikely to work as Google frequently renames the font files which will be reflected as the wordpress.org API endpoint is updated.
Screenshots, screen recording, code snippet
Site prior to WPCLI command/long form steps
Site following WPCLI command/long form steps
Typography sidebar following WPCLI command/long form steps
Environment info
AND
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: