Home Forums Feedback Json vs PHP Export Reply To: Json vs PHP Export

  • It really depends on what you want to do.

    If you export to JSON you need to read in the file to register the field group. Translation of labels cannot be done using JSON, at least I don’t think they can. JSON files a good if you will use the field group without altering it. JSON also make it easier to modify the group in the future since you and import the group, work on it, and then export it again. This is the biggest plus, especially if you’re going to distribute a plugin or theme and there’s a chance it can change in the future. Reading JSON files will cause a theme to fail the theme check. It has a rule about reading files.

    PHP is good if you want to build something dynamic. Field groups that may or may not be used based on other settings. Fields that may or may not be used based on settings or the current site. PHP does not require opening and reading files so it will pass the theme check. If you want to modify the group using ACF in the future you’ll need to rebuild the group manually unless you also have a JSON copy of it for import.