Support

Account

Home Forums Feature Requests One Directional Sync

Unread

One Directional Sync

  • I want to have a plugin that defines my Base ACF structure that I use across all of our sites we build. I still need the ability to modify the structure for specific client needs. I would like to have the ability to keep sites up to date with our Base ACF structure however.

    I’ve been playing around adding my plugin as a load_json path. I added a test field and synced it. I created an acf-json folder in my theme, so it saves the structure there.

    If I manually add another field, the entire stucture gets saved to my theme acf-json folder, which is fine. If I then add another field to my plugin’s ACF, I see I can sync them.

    My issue is, it wants to overwrite my local acf fields that I created. What I want to do is only bring IN the changes from the plugin.

    Example:

    Base ACF Plugin

    
     { 
                "key": "field_686ff4418f6cd",
                "label": "Test Field 1",
                "name": "test_field_1",
     }
    

    Define Field in Theme

    
     { 
                "key": "field_686ff4849c814",
                "label": "Test Field 2",
                "name": "test_field_2",
     }
    

    Update Base ACF Plugin

    
     { 
                "key": "field_243cc2251d954",
                "label": "Test Field 3",
                "name": "test_field_3",
     }
    

    In this case I would want all three fields to exist, only bringing in the new fields added to my plugin.

    Or is there a better way about going about this. I imagine something like this is a pretty common thing agencies want to do. I am also playing around with defining it via PHP but the JSON is so much more convenient, especially if the admin UI editor can be retained.

    Other thoughts
    I realize the diff editor is just doing a file diff, and not actually comparing items based on their key which poses an implementation change to support this.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.