jofrysutanto/windsor
Composer 安装命令:
composer require jofrysutanto/windsor
包简介
YAML-ised Configuration for ACF
README 文档
README
This package extends Advanced Custom Fields plugin for WordPress and enable developers to write their ACF fields blazingly fast in configuration file.
Features
- Permanently lock your custom fields in your version-controlled code, preventing accidental edits that quickly leads to out-of-sync configurations.
- Create your fields much faster, especially when complimented with the IDE integration.
- Composition is at the heart of it. Write your own rules to further supercharge your development productivity.
Getting Started
- The easiest way to install Windsor is to use composer:
composer require jofrysutanto/windsor
- If you are using VSCode, be sure to add the Schema file to your configuration.
- Ensure you have included composer auto-loader file. If you're not sure, add the following line into your
functions.phpfile:
require_once __DIR__ . '/vendor/autoload.php';
- Register Windsor on ACF initialization. You may also do this in
functions.phpfile:
function register_acf_windsor() { \Windsor\Capsule\Manager::make()->register(); } add_action('acf/init', 'register_acf_windsor');
- Create YAML entry file at
[your-active-theme]/acf-fields/index.yaml, where[your-active-theme]refers to your currently active WordPress theme directory. At minimum, your entry file should contain:
fields: [] pages: [] blocks: []
- Test your installation:
- Create your first custom field YAML, for example create a file
your-theme/acf-fields/page-default.acf.yaml:
title: 'Page Default' key: 'page_default' position: 'acf_after_title' hide_on_screen: [] location: - - param: 'page_template' operator: '==' value: 'default' fields: heading: type: text label: Heading
- Register this new ACF file in your index:
fields: [] pages: - page-default.acf.yaml blocks: []
- You have successfully registered a new field group which will be made available when creating a new default page.
- Create your first custom field YAML, for example create a file
- Check out our full documentation below. Now go and create beautiful ACF fields!
Migrating Existing Fields
If you have existing field groups created through ACF interface, you can easily export them out to YAML by enabling the exporter through ui configuration when registering Windsor:
function register_acf_windsor() { \Windsor\Capsule\Manager::make([ 'ui' => true ]) ->register(); } add_action('acf/init', 'register_acf_windsor');
Once enabled, you access the exporter within WordPress backend by clicking on Custom Fields > Export to YAML link in sidebar.
More information about this tool can be found in configurations section.
Learn More
Check out full documentations at https://windsor-docs.netlify.app/
IDE Integration
Only VSCode integration is available at the moment. To enable autocompletion and useful snippets, follow the installation steps below:
- If not already installed, download and enable YAML language server extension.
- Update your VSCode settings (i.e.
settings.json):
"yaml.schemas": { "https://windsor-docs.netlify.app/schema.json": "*.acf.yaml" }
Credits
This package is written to be used with Advanced Custom Fields plugin by Elliot Condon, who deserves most of the credits for delivering and maintaining such an incredible plugin for WordPress developers.
If you have not already started using Advanced Custom Fields, be sure to check it out; it will definitely be worth your while.
jofrysutanto/windsor 适用场景与选型建议
jofrysutanto/windsor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.22k 次下载、GitHub Stars 达 54, 最近一次更新时间为 2020 年 06 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「advanced-custom-fields」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jofrysutanto/windsor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jofrysutanto/windsor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jofrysutanto/windsor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Hide ACF settings page on non-development enviroments.
Simple set of helper functions for ACF Fluent auto-loaded with Composer using generic function names.
Migrate ACF custom fields to Meta Box
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.
Standard interface for WordPress Advanced Custom Fields
Extension of the Fusion library to add model functionality
统计信息
- 总下载量: 9.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 54
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-06-12
