Home Forums ACF PRO Local JSON in a multisite instance


Local JSON in a multisite instance

  • I am using Local JSON to make a series of fields portable with some themes I am building. These themes are going to be made available on a large multisite network.

    We’d like to be able to activate a theme on a site and have all the fields defined in Local JSON available to that site, BUT any fields subsequently added should not appear in any other site using the same theme.

    Has anyone had to solve this issue before, or can suggest a tactic that might do it?

    A couple of ideas:

    – Make the acf-json folder read only on the server.
    – Make a plugin that will ensure fields are only synced when debug mode is enabled.
    – Use a child theme for EVERY site so new fields are added to that and not the parent.

  • The only real solution is to use a child theme on the site where the local JSON is defined in the parent theme and there is no local JSON folder in the child theme. Then you can set a second load path to load the JSON files in the parent theme

    A solution for saving local JSON for and fields created in the child theme sub site would be to create a place outside of the theme to save and load field groups in the child theme. For example, when the theme is activated you can create an acf-json folder in wp-content/uploads/sites/{$site_id}/ and set the save and load points for the child theme to this location and this would create a unique location for json files for each site.

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

You must be logged in to reply to this topic.