Git and deploys
Git and deploys
Keep your fields in files, move them to another site and check them before a deploy.
In this chapter
Keep my fields under version control
Nothing to set up. Every group you save is written to ugly-json/.json in your theme (and content types and options pages to content-types.json and options-pages.json). Commit the…
Take a new group into another site
How do I…? Options, blocks and deploys
See what changed in a file before I take it
Saving never writes over a file that changed while a screen was open: it refuses and tells you.
Check my files before a deployPro
It reads every JSON file like the builder would and exits with code 1 if one is not valid. Without WP-CLI, use Settings → Tools → Check the JSON files, which only reads and changes nothing.…
Deploy from a scriptPro
Put set -e at the top and a broken file stops the deploy before sync can run. See A deploy script.
Bring in my ACF groups
Then change the function names in your theme: get_field() → ugly_get(), the_field() → ugly_show(), have_rows() loops → foreach ( ugly_rows() … ). The values already saved keep showing. The…
Copy my groups to another site
With a file:
Write the JSON files in another folder
By default the files are written in ugly-json/ of your theme. Two filters change it: ugly_json_paths (where files are read from) and ugly_json_save_path (where they are written).
No page matches. Try another word.
Did this article answer your question?
Thank you. It helps us make the documentation better. Need more help?