-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Expose Gutenberg Data Format version in the REST API #6436
Conversation
lib/compat.php
Outdated
array( | ||
'get_callback' => 'gutenberg_get_content_block_format', | ||
'schema' => array( | ||
'description' => __( 'The current version of the block format that this post users.', 'gutenberg' ), |
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.
Typo: uses
From our friend |
🕺🏻 |
I don't love this solution to the problem, as it seems to fall into the category of "let's shove a bunch of extra data onto the Post resource." Can you describe the other approaches proposed? We have a |
@danielbachhuber: I agree, that's definitely a better place to put it. Is there a filter for the schema that would let me add that? If not, |
801e31f
to
f002329
Compare
Actually, I just went with adding it to the post response for now. We can do it properly in the merge. |
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.
Works and looks alright to me. I might wait for a second opinion, up to you. :)
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've added a @todo
marker for registering on the schema.
Description
As described in #6435, it would be valuable to third party tools if we exposed a canonical block format version for the content of the current post, so they could decide how to handle the post.
For now, this is simply
0
, for "no blocks", or1
, for "yes, there are blocks".Checklist: