beapi/gutenberg-serializer
最新稳定版本:1.0.1
Composer 安装命令:
composer require beapi/gutenberg-serializer
包简介
Serialize gutenberg blocks array to a string
README 文档
README
Package to transform Gutenberg block array to a Gutenberg firendly string
Purpose
This package allows you to use a block array from "parse_blocs" for example, and serialize it into Gutenberg compatible content. This can be used to migrate content from blocs or programmatically generate content for Gutenberg. The library supports innerBlocs.
Example
$bloc = [ [ 'blockName' => 'core/paragraph', 'attrs' => [ 'id' => 4 ], 'innerBlocks' => [], 'innerHTML' => ' <p>This is a content</p> ', 'innerContent' => [ 0 => ' <p>This is a content</p> ', ], ] ]; $content = BlocksSerializer::from_array( $bloc );
Will become :
<!-- wp:paragraph {"id":"4"} -->
<p>This is a content</p>
<!-- /wp:paragraph -->
Commands
You have commands into the project :
composer cs: Check the coding standardscomposer cbf: Beautify automatically all the files of the projectcomposer test: Launch the testscomposer psalm: Launch psalm on the files
统计信息
- 总下载量: 5.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-03-20