Hi there! Opening this thread as a public topic, although it’s actually for the development team of ACF:
Could you guys add a WP CLI command to sync all ACF field groups to the ACF core? This would come in very handy for automated synchronization between various environmetns. I have build a little plugin that does this, but really think that it would be a very nice feature to have officially supported.
Here’s a gist of my plugin: https://gist.github.com/hirasso/c48c04def92f839f6264349a1be773b3
Install it and call the command like this:
wp rhau acf-sync-field-groups
(rhau is just my namespace for all my custom wp cli commands).
Thanks @hube2 , I have also written to the ACF team directly. Just thought that until the feature lands in ACF, my little plugin could come in handy for other users as well.
I have already received a reply from the ACF devs. They will consider introducing a similar functionality in ACF core! 🎉
HI, @rasso I marked the post as private so you could check I wasn’t doing something wrong. I have updated to your latest gist and the error went away. I need to test with some fields that need a sync, currently
$field_groups_class->sync is empty. I’m excited you made this code, it’s going to save time when I deploy across multiple environments.
@rasso I just want to thank you for contributing your crucial plugin. I have it in my bitbucket-pipelines deployment script, where I’m updating many sites. I’ve been looking for this for years. This should be a built-in ACF feature, I’ll tag @iainpoulson just for grins 🙂
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!