Support

Account

Home Forums Backend Issues (wp-admin) How to sync field groups from local Json in plugin

Helping

How to sync field groups from local Json in plugin

  • I updated my workflow so that I am developing blocks within a plugin rather than within the theme. I’m developing the plugin locally and deploying the plugin to production. Everything is going great.

    But I have just one problem.

    When I modify field groups locally, those changes are reflected in the plugin’s acf-json folder. But I don’t see a Sync option when I deploy my plugin to the server with those updated field groups.

    Here’s the code I’m using in my plugin to change the acf-json path.

    add_filter('acf/settings/save_json', 'my_acf_json_save_point'); 
    function my_acf_json_save_point( $path ) {
        // update path
        $path = plugin_dir_path( __FILE__ ) . '/acf-json';
        
        // return
        return $path;
    }

    ACF Version 5.8.7

  • You need to add a load point to also load the json from the location that you’re saving to.

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

You must be logged in to reply to this topic.