Support

Account

Home Forums ACF PRO Opinion: Register fields via PHP or Local JSON? Reply To: Opinion: Register fields via PHP or Local JSON?

  • I personally like using the JSON files because they are easier to change in the future… import the field group, make a change and then export it again.

    I build all of the field groups in ACF, even when I’m going to put them in PHP. Much easier than trying to code them. I also save a copy of the json file should I want to make changes in the future. Although, if I’m putting them in PHP it usually for a specific reason, for example, if something needs to be dynamic, lets say that I also create an options page that lets the user choose what post types and/or templates the field group would be on, or if I want to allow another admin to decide what other features of the page should be available, like page options or feature images.

    The main difference for me between json or php is the ability to translate. If I’m creating a plugin and I want to add my text domain this is fairly easy in PHP, at least for me. I might be missing something, or I just don’t understand the process, but translating the strings in the JSON file would be a much more difficult task, and one that I personally don’t know how to do if it is possible.