creode/wordpress-blocks
最新稳定版本:3.0.0
Composer 安装命令:
composer require creode/wordpress-blocks
包简介
Block library and block development framework for WordPress blocks.
README 文档
README
This is a WordPress plugin which contains a few blocks to assist in starting out a new project. The blocks are built using the WordPress ACF and the block editor. This module also contains infrastructure to assist in the creation of template based blocks.
Installation
Installation of this can be done using composer: composer require creode/wordpress-blocks
Usage
This plugin once installed will be added to the mu-plugin folder so it is ready for it to be used in your project.
Creating new blocks
In order to create new blocks, you can add a new class to your theme or plugin and extend the Creode_Blocks\Block class.
If you are utilising WP_CLI for your project, you can use the following command to create a new block class:
wp make-block "Creode Footer" --theme="creode"
This will create a newly configured block class and template file within your theme, inside the blocks directory. The theme argument is optional and will default to the current theme.
It will also output a couple of lines that can be copy and pasted into your functions.php file to include the block class and get started quickly.
Creating child blocks
Child blocks are defined within your block class inside the child_blocks() function. You can just need to return an array of new Creode_Blocks\Child_Block instances from it.
Generating documentation locally
This package uses PHPDoc to generate documentation for the blocks. To generate the documentation for testing purposes, you can run the following docker command:
docker run --rm -v $(pwd):/data phpdoc/phpdoc
This will create a new build/docs folder so you can view the documentation locally.
Roadmap
- Ongoing: Continue to expand the base offering of block classes
- Implement a command to create new blocks in your theme using
WP_CLI
creode/wordpress-blocks 适用场景与选型建议
creode/wordpress-blocks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.81k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 creode/wordpress-blocks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 creode/wordpress-blocks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-07-11