When updating a group field or a repeater field you need to use the correct structure for the array. In your case you would update the group field with an array containing all of the sub fields that you want to update.
// let's assume that the field key of the group is field_GGGGGGG
$group_key = 'field_GGGGGGG';
$value = array(
// the value off a group is an array
// consisting of "field key" => "sub field value" pairs
// assume field_TTTTTTT is a text field
'field_field_TTTTTTT' => 'value of text field',
// assume that field_RRRRRRR is a repeater
'field_RRRRRRR' => array(
// a repeater value is an array
// each nested array is a row in the repeater
// each element of the row contains
// "sub field key" => "sub field value" pairs
'field_1111111' => 'sub field 1 value'
'field_2222222' => 'sub field 2 value'
update_field($group_key, $value, $post_id);
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users