-
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
Try making server aware of block variants #1015
Conversation
src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
Outdated
Show resolved
Hide resolved
f0adc81
to
6b17d34
Compare
This is looking good. I think we should plan to land it in WordPress core short after |
src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
Show resolved
Hide resolved
3561c57
to
50506a8
Compare
src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
Outdated
Show resolved
Hide resolved
We need a ticket in Trac to proceed further. As far as I can tell, there are only two remaining changes required:
|
Thanks @gziolo @TimothyBJacobs for all the reviews! I think I responded to all feedback, but let me know if I missed any items. I also created a trac ticket: https://core.trac.wordpress.org/ticket/52688#ticket |
I'm adding the Trac ticket to my list of items to take care of later this week. I want to wait until WordPress 5.7 is out before committing. Nice work @gwwar ✨ |
This landed in 380d044 💖 |
https://core.trac.wordpress.org/ticket/52688
Experiment, required for WordPress/gutenberg#29095
This PR exposes
variations
in the block type definition and adds two new labelsitem_link
anditem_link_description
for post types and taxonomies.Changes here will allow us to populate link navigation variations via
register_block_type_from_metadata
without needing to update the post type and taxonomy REST APIs to allow filtering byshow_in_nav_menus
.Testing Instructions
npm run build
)/wp/v2/block-types
. Notice how there is a new variations field returned.npm run test:php -- --filter REST_Block_Type_Controller_Test
If you like, also follow test instructions in WordPress/gutenberg#29095.
navigationlink.mp4
Default label behavior