Support

Account

Home Forums Add-ons Flexible Content Field Issues with add_rows and flexible content Reply To: Issues with add_rows and flexible content

  • I’m not 100% sure what you should send to update field for a flex field.

    I know that for a repeater you can so something like this:

    
    $repeater = array(
      // nested array for each row
      array(
        // element for each field
        'field_1234567890' => 'value',
      )
    );
    

    I would definitely use field keys here, especially if you’ll be adding values that don’t exist yet, like the first row.

    Most of the time, if you do the following you can see what you need to supply for update_field(). What is returned here usually works in reverse for updating if you replace field names with field keys. But again, I’m not 100% sure on the flex field.

    
    $flex_field = get_field('my_flex_field', false, false);
    echo '<pre>'; print_r($flex_field); echo '</pre>';