wordpress - How to add new ACF fields by PHP?
one text
Whole day I have been working on this trouble but could not find needed information. Okay, I need adding new fields in the ACF group by PHP. I tested function acf_add_local_field. Nothing working. I see that function go to $store->set( $key, $field )->alias( $key, $name );. And everything should be okay but fields not add. Please, help me. How I can add new ACF fields by PHP? Only fields without group. I have needed group.
acf_add_local_field(
array(
'key' => "generalInfo_".$value,
'label' => $value,
'name' => "generalInfo_".$value,
'type' => 'text',
'parent' => 'generalInfo',
'parent_layout' => 'group_6187fed087950',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array('width' => '70')));
}
Source