leoloso / wp-block-data
WordPress plugin to extract all data from all blocks inside a of post (created with the Gutenberg content editor)
Installs: 50
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- composer/installers: ^1.6
This package is auto-updated.
Last update: 2020-08-21 10:57:58 UTC
README
WordPress plugin to extract all data from all blocks inside of a post (created with Gutenberg)
Install
Install the plugin via Composer
$ composer require leoloso/wp-block-data
And then activate the plugin "WordPress Block Data"
Usage
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}
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email leo@getpop.org instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.