wp-kit/gutenberg-object-plugin
Composer 安装命令:
composer require wp-kit/gutenberg-object-plugin
包简介
Saving Gutenberg as a clean array of data to the database
README 文档
README
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::classtoresources/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
统计信息
- 总下载量: 80
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2019-05-30