-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove preview from Font Family & Font Face APIs #59569
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/fonts/class-wp-rest-font-faces-controller.php ❔ lib/compat/wordpress-6.5/fonts/class-wp-rest-font-families-controller.php |
Size Change: +10 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
At this point, with the preview arg being part of the font family and font face API endpoints in WP 6.5, I think we should close this PR and create an issue if this is still something we want to do. Deprecating the preview property will be more involved: we'll need to extend the controller classes from core to override them in Gutenberg with the necessary changes. |
What?
Remove the preview property from the Font Face and Font Family APIs
Don't send the preview property when creating Font Face and Font Family APIs from the client
Why?
The preview has limited value once a font is installed. (Not NO value, but limited. Any font INSTALLED and ACTIVATED will already have the font assets loaded in the browser and the preview isn't needed. Only fonts INSTALLED and NOT ACTIVATED would get a SMALL benefit from using previews.). However since previews are SVG assets they aren't available to be imported into WordPress due to security concerns.
Rather than managing preview assets (at all) for fonts that have been installed instead just remove that from something that we need to be concerned with.
Previews remain unchanged for Font Faces and Font Families that are in a Font Collection.
Testing Instructions
Using the Install Fonts tab make sure the previews are rendered with SVG files.
Install a Font and go to the Library Tab
Ensure the font that was just installed has a preview rendered with the font resource.