-
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
Font Library: singularize install font families endpoint #57569
Font Library: singularize install font families endpoint #57569
Conversation
…mily instead of many in the same request
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/experimental/fonts/font-library/class-wp-rest-font-families-controller.php ❔ phpunit/tests/fonts/font-library/wpRestFontFamiliesController/installFonts.php |
Size Change: +1.5 kB (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and verified the following via the UI:
✅ Font families can be installed (singularly)
✅ Cannot upload or install variants of more than one font family
✅ Tests pass locally
I left a few minor comments all related to the same issue.
While testing I discovered that a notice is being thrown related to the REST API anytime the Font Library UI is loaded:
PHP Notice: Undefined index: paged in /site/path/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php on line 394
PHP Stack trace:
...
PHP 13. WP_REST_Font_Families_Controller->get_items() /site/path/wp-includes/rest-api/class-wp-rest-server.php:1193
It probably started when we updated the REST Controller to extend the Posts Controller, so we can address it separate from this PR.
Approving so long as the minor comments are addressed, LGTM.
lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
Yep that notice is related to the implementation of the Post Rest Controller, we could work on it on a separate PR. I created an issue with your report. Thanks for testing and reviewing @jffng ! |
What?
Why?
To make the
POST /font-families/
endpoint accept only one font family per request instead of many.This is part of the effort around refactoring the Font Library API.
How?
Removing the capability to install several font families using only one request.
Testing Instructions