WordPress plugin to extract all data from all blocks inside of a post (created with Gutenberg)
Install the plugin via Composer
$ composer require leoloso/wp-block-data
And then activate the plugin "WordPress Block Data"
Obtain the Gutenberg data for all blocks in a post with ID $post_id
like this:
$post = get_post($post_id);
$block_data = get_block_data($post->post_content);
The data can also be retrieved through the following REST endpoint:
/wp-json/wp/v2/post-block-data/{POST_ID}
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email leo@getpop.org instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.