Font Library refactor: Migrate legacy font family content #58032
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
In #57688, we are changing the post_content of
wp_font_family
posts and splitting out the font faces into separatewp_font_face
posts.This change adds a migration so fonts previously installed with the old format will continue working.
Why?
To prevent Gutenberg plugin users from loosing installed fonts when the refactor lands.
How?
Running a one-time migration function on the
init
hook.Testing Instructions
You may also want to check that the database content is correct
gutenberg_font_family_format_converted
option is set after the migrationfontFace
json array items contained withinwp_font_family
content are moved to newly createdwp_font_face
posts_gutenberg_legacy_font_family_format
post meta for each family_wp_font_face_file
post meta created for their font file assets