Support

Account

Home Forums Front-end Issues Update parent and child repeater programmatically Reply To: Update parent and child repeater programmatically

  • It has to be in the way that you’re constructing the nested array. Going to be honest, I’m not exactly sure what the problem is. In your first code if you can output the array that you’ve constructed that might tell you where it’s going wrong

    
    echo '<pre>'; print_r($data); echo '</pre>';
    update_field( $field_key, $data, $post_id );
    

    I can tell you that in your second code you have a similar problem to the first code you poasted. You are trying to add a sub row to a repeater that does not exist yet. add_sub_row() is called before the update_field() call that creates the repeater that you want to add the row to.