-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Add all REST API endpoints. #6034
Font Library: Add all REST API endpoints. #6034
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 Core SVNCore Committers: Use this line as a base for the props when committing in SVN:
GitHub Merge commitsIf 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. |
src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php
Outdated
Show resolved
Hide resolved
33add01
to
b48285e
Compare
Working on fixing the unit tests. |
// Disable autosave endpoints for font families. | ||
'autosave_rest_controller_class' => 'stdClass', |
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.
Aside:
We should really find a better way to avoid hacks like this. I don't think this is a clean way at all, and devs will just copy this sooner or later.
If workarounds like this are added/needed in GB it's a sign that we should improve core, not just bring the workaround into core.
Maybe it could be handled via post type supports, i.e. add_post_type_support( 'autosave' )
/ remove_post_type_support( 'autosave' )
. I suppose https://core.trac.wordpress.org/ticket/41172 could be used to track this, maybe I can take a stab at it.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@youknowriad In #6027 it was mentioned that |
898a244
to
2eb4cc3
Compare
src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
@swissspidy Yes, that function is used here wordpress-develop/src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php Lines 848 to 872 in 2eb4cc3
|
Anyone knows how to regenerate the |
Try running:
or:
|
72b119f
to
9635c4e
Compare
@ocean90 Both of these options return a different version of that file 🤷 Not sure what I'm doing wrong. |
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.
Looking pretty good.
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php
Outdated
Show resolved
Hide resolved
Looks like all the feedback have been addressed here. I'll be committing this shortly if there's no other blocker. |
Trac ticket: https://core.trac.wordpress.org/ticket/59166
This builds on top of the initial Font Library API PR and adds the necessary REST API controllers to make the Font Library work properly.
Testing instructions