humanmade/block-supports-extended
Composer 安装命令:
composer require humanmade/block-supports-extended
包简介
Block supports extension helpers
README 文档
README
- Tested up to: 6.3
- License: GPL-2.0-or-later
Helpers for extending built in block support features such as color options.
Description
To use the plugin you will need to activate it and then register your new block supports properties like so:
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', ], ] );
This will have the effect of extending the core quote block's block.json like so:
{
"supports": {
"color": {
"quoteMarks": true
}
}
}
A "Quote Marks" option will be added to the default block colour settings. Everything else included CSS generation is then handled for you.
Future Roadmap
Currently only the color feature is supported, but we will likely extend this to typography, border etc…
Depending on the future direction of WordPress core which promises to make the styles engine more pluggable we may continue extending this or keep it limited.
Installation
This section describes how to install the plugin and get it working.
e.g.
- Upload the plugin files to the
/wp-content/plugins/block-supports-extendeddirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress
Changelog
0.1.0
- Release
humanmade/block-supports-extended 适用场景与选型建议
humanmade/block-supports-extended 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.88k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2024 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 humanmade/block-supports-extended 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 humanmade/block-supports-extended 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-01-16
