Support

Account

Home Forums ACF PRO Add WP CLI command to sync all ACF Field Groups

Solved

Add WP CLI command to sync all ACF Field Groups

  • 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).

  • The development team does not routinely visit this forum, you need to send feature requests to them here https://www.advancedcustomfields.com/contact/

  • 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! 🎉

  • This reply has been marked as private.
  • Hi @nmaine , what’s the reason you did mark your post as private? Just curious 🙂

    Anyways – there were a few internal changes in ACF some versions ago, the gist was outdated. I have updated the code so that it should work with the latest version of ACF again.

  • 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 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.