Home › Forums › General Issues › Cannot update repeater field! › Reply To: Cannot update repeater field!
sorry I didn’t get back to you sooner, your email got buried.
Anyway, you need to use the field keys. Look in the admin on the field group editor. If you don’t see the field keys set them to display under screen options.
When you construct your array you use the field keys in place of the names, it will look something like this
$array = array(
// nested array for each row
array(
// row 1
// element for each field
'field_123456' => 'value 1', // this key is the acf field key
'field_234567' => 'value 2',
// ... etc
),
array(
// row 1
// ... etc
),
// ... etc
);
and use the field key in update field
// use the field key of the repeater here
update_field('field_xyz120', $array, $id);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.