2017 © Pedro Peláez
 

wordpress-plugin acf-sync

Keep your ACF field groups synchronized between different environments

image

freshflesh/acf-sync

Keep your ACF field groups synchronized between different environments

  • Tuesday, January 6, 2015
  • by FreshFlesh
  • Repository
  • 4 Watchers
  • 19 Stars
  • 83 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

ACF Sync

Author Note : Since 5.1.5, ACF now includes its own manual syncing feature ! I recommend using this feature instead of the ACF Sync plugin for manual synchronization. ACF Sync is still relevant if you need automatic synchronization between different environments, especially on production instances where the ACF UI shouldn't be accessible to users. I will release soon a 2.0 version that will take advantage of the 5.1.5 features and will drop the manual synchronization feature, (*1)

ACF Sync is a little WordPress plugin that let you keep your ACF field groups synchronized between different environments., (*2)

It ensures you to always have up-to-date fields across different development and production environments without the need to export/import your ACF fields manually., (*3)

This was inspired from this nice article from Sean Butze about deploying ACF field groups, except it has been adapted to work with ACF 5 and its new local JSON Feature., (*4)

Installation

Install this plugin along with ACF > 5.0.0., (*5)

  • Using git clone : git clone https://github.com/FreshFlesh/ACF-Sync.git
  • Using composer : composer require freshflesh/acf-sync

How does it work ?

To synchronize your field groups across your dev team, you need to version the JSON files produced by ACF with GIT or any other SCM tool., (*6)

See here to learn more about the local JSON functionality and how to activate it on your website., (*7)

Auto Sync

You can automatically synchronize your field groups by defining a ACF_FIELDS_VERSION constant somewhere in your code., (*8)

It should contain your field groups version, following the version_compare php function format., (*9)

Example : define('ACF_FIELDS_VERSION', '1.0.0');, (*10)

You might want to put this constant with your Custom Post Type definitions, for example : - in a project core plugin - in a project config file - in your theme functions.php, (*11)

Whenever you update your fields in the WordPress admin, update the ACF_FIELDS_VERSION constant to a new version ; for example 1.0.0 to 1.1.0., (*12)

When another developer of your team will fetch your changes and new JSON files, ACF Sync will know they are newer than the ones in database, and will automatically import them back in database when accessing the WordPress Admin., (*13)

Of course ACF Sync can also be used to synchronize fields groups between development and production environments., (*14)

Manual Sync

Aside from the Auto Sync feature, ACF Sync lets you synchronize your field groups manually if your prefer to have more control on how and when field groups should be imported., (*15)

When activated, it simply add a new option on the Import/Export setting page of ACF., (*16)

Environment based configuration

ACF Sync also optionally lets you use a WP_ENV constant to disable saving to JSON and hide the ACF UI on staging and production environment to avoid mistakes on non-development environments., (*17)

If you use the Bedrock WordPress stack, WP_ENV is already defined in the config, otherwise you can define it yourself in your wp-config.php., (*18)

Licence

MIT, (*19)

The Versions

06/01 2015

dev-master

9999999-dev

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • wordpress/wordpress >=3.5

 

by Thomas Charbit

16/12 2014

1.1.2

1.1.2.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • wordpress/wordpress >=3.5

 

by Thomas Charbit

02/12 2014

1.1.1

1.1.1.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • wordpress/wordpress >=3.5

 

by Thomas Charbit

19/11 2014

1.1.0

1.1.0.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • wordpress/wordpress >=3.5

 

by Thomas Charbit

18/11 2014

1.0.2

1.0.2.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Thomas Charbit

11/11 2014

1.0.1

1.0.1.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Thomas Charbit

09/11 2014

1.0.0

1.0.0.0

Keep your ACF field groups synchronized between different environments

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Thomas Charbit