evanshunt/carbon-fields-rich-text-no-media
Composer 安装命令:
composer require evanshunt/carbon-fields-rich-text-no-media
包简介
Carbon Fields extension, that adds a Rich Text field type with no media.
README 文档
README
Step-by-step guide on how to create a new Carbon Field.
Introduction
The Carbon Fields library has many built-in fields, but you may find it necessary to define a new type of field for your specific project needs.
The following tutorial will explain how to create a custom Carbon Field.
Step 1: Download the template
To make it as easy as possible, we have prepared a Carbon Field template that contains a frame for the PHP Carbon Field class and a webpack build process.
You can download the template from here: https://github.com/htmlburger/carbon-field-template
Template Structure
/assets/css- css folder/assets/js- JavaScript files folder/languages- folder for .po, .mo and .pot files/core- folder for all of your .php files/field.php- bootstrapping php code
Step 2: Name your field
Replace the YOURFIELDNAME and yourfieldname (case sensitive) placeholders in all files. Also rename the files that contain the placeholders.
NB! If your field name contains multiple words, for example Image Gallery, your class names should look like this:
- PHP class:
Image_Gallery_Field - React Component Registration:
image_gallery(refer toregisterFieldComponent@/assets/js/bootstrap.js)
Step 3: Build assets
- Edit
webpack.config.jsand make sureconst rootpoints to the directory where Carbon Fields are installed (e.g.const root = path.resolve(__dirname, '../vendor/includes/htmlburger/carbon-fields');) - Execute
npm installin the root directory to install all build process requirements. - Execute
npm run buildto build the final minimized assets
Optional
Execute npm run dev to continuously build assets during development. Note that you should add define( 'SCRIPT_DEBUG', true ); to your wp-config.php file in order to load the files generated by the dev build process.
Step 4: Customize
Here is a quick overview of some of the methods you can customize:
PHP
to_json()
You can use this method to modify the field properties that are passed to the React component which represents the field.
field_type_activated
Used for initialization processes that are called once per field type (e.g. setup localization files).
admin_enqueue_scripts()
Used to enqueue CSS/JavaScript files.
admin_init()
Called for each field instance when the field is initialized. (back-end)
init()
Called for each field instance when the field is initialized. (back-end, front-end)
evanshunt/carbon-fields-rich-text-no-media 适用场景与选型建议
evanshunt/carbon-fields-rich-text-no-media 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.66k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「carbon-field」 「carbon-fields-rich-text-no-media」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 evanshunt/carbon-fields-rich-text-no-media 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 evanshunt/carbon-fields-rich-text-no-media 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 evanshunt/carbon-fields-rich-text-no-media 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Carbon Fields extension, that adds a Icon field type.
Carbon Fields extension, that adds a SmartLink field type.
A basic Carbon Fields extension, that adds support for Number type field.
Carbon Fields extension, that adds a URL picker field type.
Carbon Fields extension, that adds a Radio_Image_Enhanced field type.
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
统计信息
- 总下载量: 1.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2018-11-30