Download the PHP package wp-kit/gutenberg-object-plugin without Composer
On this page you can find all versions of the php package wp-kit/gutenberg-object-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wp-kit/gutenberg-object-plugin
More information about wp-kit/gutenberg-object-plugin
Files in wp-kit/gutenberg-object-plugin
Package gutenberg-object-plugin
Short Description Saving Gutenberg as a clean array of data to the database
License GPL-3.0
Informations about the package gutenberg-object-plugin
Gutenberg Object Plugin
The purpose of this plugin is to save Gutenberg (New WordPress Editor) data as an array in the database which is accessible via the REST API.
Forked from royboy789, this plugin is intended for to be used with Rest-Kit. This plugin adds in some ACF support too with a predictable and useful JSON output. It's similar to acf-to-rest-api plugin but applies to Blocks.
Installation (With Rest-Kit)
- Run
composer require wp-kit/gutenberg-object-plugin
- Add
'GUTENBERG_OBJECT_PLUGIN_CPTS' => 'page'
toresources/config/constants.config.php
- Add
GutesObjectPlugin\Provider::class
toresources/config/providers.config.php
Installation (Wordpress)
- Download Zip and upload to Wordpress plugin directory
- Add
define('GUTENBERG_OBJECT_PLUGIN_CPTS', 'page');
tofunctions.php
- Add
(new GutesObjectPlugin\Provider)->register();
tofunctions.php
Database
Data will be saved in a new database table [prefix]_gutes_arrays
JSON
Block data gets appended editor_blocks
on the normal page/post responses.
Endpoints
Includes 1 new route:
wp-json/gutes-db/v1/[post-id]
- Supports GET & POSTwp-json/gutes-db/v1/[post-id]/revisions
- Supports GET only
GET
GET: wp-json/gutes-db/v1/[post-id]
Returns
- __is_gutes__: Is the post created with Gutenberg
- __post_id__: Post ID
- data: Gutenberg Data
- _embedded['post']: optional with _embed - response from WP REST API for post