Support

Account

Home Forums ACF PRO Import PHP generated fields into ACF GUI

Helping

Import PHP generated fields into ACF GUI

  • Hello
    I’ve a whole bunch of fields created by using the ‘acf_add_local_field_group’ function – how can I get those fields showing up in the ACF GUI – thank you in advance for your input.

  • Most of these functions to not have documentation, you need to dig around in ACF code. After the field group is completely set up, get the field group.

    
    $group = acf_get_field_group[$group_key];
    

    then get the fields for the group

    
    $group['fields'] = acf_get_fields[$group_key';
    

    then write the field group to a file

    
    $filename = '/aba/path/to/your/file.json'
    $handle = fopen($file, 'w');
    fwrite($handle, json_encode($group));
    fclose($handle);
    

    then you can download this file from the server and import it to ACF.

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

You must be logged in to reply to this topic.