开发流程-WordPress高级自定义字段 [英] Development flow - Wordpress Advanced Custom Fields

查看:93
本文介绍了开发流程-WordPress高级自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道当为Wordpress使用Advanced Custom Fields插件时人们的开发流程是什么?

Just wondering what are peoples development flow when using the Advanced Custom Fields plugin for Wordpress?

我有我的本地开发人员,一个临时站点和产品。

I have my local dev, a staging site and production.

将我在本地创建的字段添加到暂存和最终生产中的最佳方法是什么?通过界面在暂存和生产中添加它们似乎很麻烦。

What is the best way to add the fields I created locally to staging and eventually production. Adding them via the interface on staging and production seems a hassle.

我看过导出字段组-但是field_ids有可能不同步

I've looked at exporting field groups - but is there a chance that the field_ids will get out of sync?

谢谢。

推荐答案

在以下目录的根目录中创建一个文件夹您的WordPress主题 / acf-json

Create a folder in the root of your WordPress theme called /acf-json

ACF然后会将您的所有字段和字段组复制为 .json 文件。

ACF will then copy all of your fields and field groups here as .json files.

源代码控制这些ACF .json文件,就像主题中的任何其他文件一样。确保在将更改部署到暂存和生产环境时还更新.json文件。这样,您将在每个环境中始终具有相同的字段组。

Source control these ACF .json files as you would any other file in your theme. Making sure when you deploy changes to your staging and production environments you also update the .json files. This way you will always have the same field groups across each environment.

此处有一些其他文档:
http://www.advancedcustomfields.com/resources/local-json/

There is some further documentation here: http://www.advancedcustomfields.com/resources/local-json/

这篇关于开发流程-WordPress高级自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆