问题
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