I do this all the time, that is exporting field groups to use in PHP. The field groups in PHP do not work unless I delete the field group from the ACF editor. I’ve been using ACF for a long time and I’ve never seen it possible to have a field group in ACF and created by PHP at the same time, so you were doing a trick with ACF that I wouldn’t be able to do.
If you want to get the field groups into JSON you can to this after the php for creating the group.
$file_name = $group['key'].'.json'; $json = json_encode($group);
then save the json value to the file on the server. http://php.net/manual/en/function.fwrite.php
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.