You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/font-families/ endpoints default context patameter to edit instead of view. But amost all the core endpoints set the default thecontext parameter to view. Let's change it to default to view.
It seems like we misinterpreted the meaning of the context parameter, and we used view because the font families are used by default in the editor, but that seems to be unrelated.
Thanks for taking a closer look at this, the linked article was very informative. I've opened a PR to update font-families and font-faces endpoints here: #58287
Description
/font-families/
endpoints defaultcontext
patameter toedit
instead ofview
. But amost all the core endpoints set the default thecontext
parameter toview
. Let's change it to default toview
.gutenberg/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
Line 341 in ecda32e
gutenberg/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
Lines 365 to 378 in ecda32e
Why?
It seems like we misinterpreted the meaning of the
context
parameter, and we usedview
because the font families are used by default in the editor, but that seems to be unrelated.I didn't find the docs in the rest API handbook about it, but this reading is useful: https://make.xwp.co/2017/07/25/defining-context-in-the-wp-rest-api/
Step-by-step reproduction instructions
lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
and compare it with most core endpoints.Screenshots, screen recording, code snippet
Screenshot of a search in core codebase:
Environment info
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: