Figured it out. Each of the items in the value array needed the corresponding field key rather than the field name:
$value[] = array(
'acf_fc_layout' => $acf_fc_layout,
'subfield_key_1' => $label,
'subfield_key_2' => $url
);
I was trying to add the fields similar to the example in the documentation (http://www.advancedcustomfields.com/resources/register-fields-via-php). See:
acf_add_local_field(array(
'key' => 'field_1',
'label' => 'Sub Title',
'name' => 'sub_title',
'type' => 'text',
'parent' => 'group_1'
));
I’m guessing this only works for fields in groups and not for ‘sub_fields’ in flexible content layouts?
I’m trying to separate the fields within the groups and flexible layouts to make the code more manageable and possibly reuse the same field code in another instance.
Hi @Elliot Condon
I wanted to check on this, too. Specifically, I’d like to use a dropdown for a Single select Taxonomy field used on a User form. This request is mostly for added accessibility.