beapi/gutenberg-serializer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 standards
  • composer cbf : Beautify automatically all the files of the project
  • composer test : Launch the tests
  • composer psalm: Launch psalm on the files

统计信息

  • 总下载量: 5.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-03-20