[wp-trac] [WordPress Trac] #43887: Expose Gutenberg Data Format version in the REST API
WordPress Trac
noreply at wordpress.org
Sat Apr 28 11:51:03 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 | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+-----------------------
Comment (by birgire):
This seems to belong to the ''content'' property:
{{{
if ( ! empty( $schema['properties']['content'] ) ) {
$data['content'] = array(
'raw' => $post->post_content,
/** This filter is documented in wp-includes/post-
template.php */
'rendered' => post_password_required( $post ) ? '' :
apply_filters( 'the_content', $post->post_content ),
'protected' => (bool) $post->post_password,
/** @todo: Replace with
`gutenberg_content_block_version()` when Gutenberg merges into core. */
'block_version' => ( false !== strpos(
$post->post_content, '<!-- wp:' ) ) ? 1 : 0,
);
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43887#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list