-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
What problem does this address?
If I have a site that uses multiple development environments (e.g. develop, stage, prod), and I am using the default handling of fonts (e.g. installed directly into wp-content/fonts/, not using the font_dir filter to change that path or .gitignore'ing the wp-content/fonts/ directory), my fonts are committed to source control between environments.
If I deploy my code changes (e.g. from develop -> stage or prod), including any fonts that were added in develop, the font files will get deployed to my staging/live environments, but WordPress does not know about them. Let's assume my develop environment is messy. I don't want to database clone from develop to prod to "install" the fonts, so the only thing I can do is reupload the already uploaded fonts. When I do this, I am given an error that the fonts already exist, but I can now use the font because the post type is created.
#54226 would address this partially assuming I could export fonts only from my develop environment. Currently, doing this results in an unrecoverable error in the Site Editor that's only able to be solved by restoring a database backup, but this is still a sub-optimal process for handling fonts that already exist in the filesystem.
What is your proposed solution?
The most user-friendly way of handling this would be to scan the font_dir for fonts when the Font Library is opened and automatically add (but not activate) any fonts that are read that are not currently listed in the Library. Possibly an update or sync files button could be listed at the bottom of the Font Library to prompt a manual sync.
Ultimately, any means of WordPress "knowing" or "seeing" that the fonts exist in some form would be preferable, even if that meant a manual process to "install" the uploaded font.