人工制造/扩展块支持

块支持扩展辅助工具

安装: 720

依赖: 0

建议者: 0

安全: 0

星标: 7

关注者: 6

分支: 0

开放问题: 1

类型:wordpress-plugin

0.2.0 2024-01-16 11:38 UTC

This package is auto-updated.

Last update: 2024-09-16 13:12:42 UTC


README

  • 测试至:6.3
  • 许可证:GPL-2.0-or-later

用于扩展内置块支持功能(如颜色选项)的辅助工具。

描述

要使用此插件,您需要先激活它,然后注册您的新块支持属性,如下所示

Block_Supports_Extended\register( 'color', 'quoteMarks', [
	'label' => __( 'Quote Marks' ),
	// Properties are translated to what the setting value is applied to,
	// for example, text will give ".selector { color: value }". This is
	// the same as the options available for the "color" block.json.
	'property' => 'text',
	// %s is replaced with a generated class name applied to the block.
	'selector' => '.%1$s blockquote::before, .%1$s blockquote::after',
	// Optional list of default blocks to add support for. This can
	// also be done via a block's block.json "supports" property, or
	// later using the Block_Supports_Extended\add_support() function.
	'blocks' => [
		'core/pullquote',
	],
] );

这将扩展核心引用块的 block.json,如下所示

{
	"supports": {
		"color": {
			"quoteMarks": true
		}
	}
}

将添加“引用符号”选项到默认的块颜色设置中。其余的CSS生成将为您处理。

Extended color UI

未来路线图

目前仅支持 color 功能,但我们将很可能将其扩展到 typographyborder 等...

根据WordPress核心的未来方向,它承诺使样式引擎更易于插件化,我们可能会继续扩展此功能或保持其限制。

安装

本节描述了如何安装插件并使其工作。

例如

  1. 将插件文件上传到 /wp-content/plugins/block-supports-extended 目录,或者通过WordPress插件屏幕直接安装插件。
  2. 通过WordPress的“插件”屏幕激活插件

变更日志

0.1.0

  • 发布