[wp-trac] [WordPress Trac] #43887: Expose Gutenberg Data Format version in the REST API

WordPress Trac noreply at wordpress.org
Fri Apr 27 22:45:07 UTC 2018


#43887: Expose Gutenberg Data Format version in the REST API
-----------------------------+------------------------------------------
 Reporter:  danielbachhuber  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  5.0
Component:  REST API         |    Version:
 Severity:  normal           |   Keywords:  needs-patch needs-unit-tests
  Focuses:  rest-api         |
-----------------------------+------------------------------------------
 From https://github.com/WordPress/gutenberg/issues/6435

 > More advanced REST API consumers will want to switch how they handle
 post_content depending on whether the content contains blocks or not, and
 (in the future) will likely want to switch based on which version of the
 block format it contains.
 >
 > Rather than requiring consumers to duplicate how Gutenberg determines
 whether to parse blocks or not, we can expose the same information in post
 objects returned by the REST API.
 >
 > Currently, it would return:
 >
 >    * `0`: The `post_content` does not contain blocks, it can be treated
 as classic content.
 >    * `1`: The `post_content` contains blocks, it should be treated
 appropriately.
 >
 > If the block format has back compat breaking changes in the future, we
 can increment this value as needed.
 >
 > For an immediate practical use, this would be useful for the WordPress
 mobile apps to decide how to handle the `post_content`: https://github.com
 /wordpress-mobile/WordPress-iOS/pull/9194

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43887>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list