Development flow - Wordpress Advanced Custom Fields

血红的双手。 提交于 2019-12-11 01:47:02

问题


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.

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

thanks.


回答1:


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

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

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.

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



来源:https://stackoverflow.com/questions/35400955/development-flow-wordpress-advanced-custom-fields

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!