My code:
if( have_rows(‘new_vendor_list’, $post_id) ):
while ( have_rows(‘new_vendor_list’, $post_id) ) : the_row();
$new_vendor_type = get_sub_field(‘new_vendor_type’);
$new_vendor_name = get_sub_field(‘new_vendor_name’);
$new_vendor_website = get_sub_field(‘new_vendor_website’);
$field_key = ‘field_5aa5a376d8aa8’;
$row = array (
‘field_5aa5a561d4254’ => intval($new_vendor_type),
‘field_5aad692a5837e’ => $new_vendor_name,
‘field_5aa5a46ed8aaa’ => $new_vendor_website
);
$i = add_row( $field_key , $row, $post_id );
endwhile; endif;
I’ve printed the array and I know it’s storing the right values, and my repeater field key will always have at least one row, so it should be working. I’m at a loss – please help? Thanks!