evanshunt/carbon-fields-rich-text-no-media 问题修复 & 功能扩展

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

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

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 to registerFieldComponent@/assets/js/bootstrap.js)

Step 3: Build assets

  1. Edit webpack.config.js and make sure const root points to the directory where Carbon Fields are installed (e.g. const root = path.resolve(__dirname, '../vendor/includes/htmlburger/carbon-fields'); )
  2. Execute npm install in the root directory to install all build process requirements.
  3. Execute npm run build to 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 evanshunt/carbon-fields-rich-text-no-media 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2018-11-30