Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

leoloso/wp-block-data

Repository files navigation

WordPress Block Data

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.

About

WordPress plugin to extract all data from all blocks inside of a post (created with Gutenberg)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages