Support

Account

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);