Support

Account

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

  • Sorry if this should be obvious to me, but here’s what I’ve done on a local project, and I’m a little confused

    1. Use ACF Pro Field Groups config (GUI) to create a Flexible Content field group
    2. Export PHP for said group
    3. Use the acf/init hook to call a function that runs acf_add_local_field_group on that PHP I exported
    4. Delete and trash the previously exported field group from ACF Field Groups config, intending to clear that from the DB
    5. Use a template that pulls in fields from that group (still seems to work)

    But now I thought somehow the ACF UI would be regenerated, for further customization, if needed. It isn’t being regenerated.

    I haven’t tried the same with JSON exports (which we’ve previously using in a completely manual way to set up new dev instances).

    Is there a trick to using PHP to regenerate the ACF Field Group config (GUI) for a field group? It’s not something that can be imported, like JSON, and it looks like there’s reference in the above discussion to exporting both PHP and JSON, maybe for the purposes of rebuilding the graphical configuration, but I’m not sure.

    I’d rather stick to one approach (just PHP or JSON). Any advice is welcome

    Thanks