Hi, Anyone can help me to update row in repeator for options in the loop?
I was trying few things…
while ( have_rows('samplerepeater','option') ) : the_row();
// 1)
update_sub_field('samplefield1', 'lorem');
// 2)
update_sub_field('samplefield1', 'lorem','option');
// 3)
update_sub_field('samplefield1', 'lorem','options');
$newval[] = array('samplefield1' => 'lorem1', 'samplefield2' => 'lorem2');
// 4)
update_sub_field( 'samplerepeater', $newval,'option');
// 5)
update_sub_field( 'samplerepeater', $newval,'options');
// 6)
update_sub_field( 'samplerepeater', $newval);
endwhile;
and nothing want work 🙁 any ideas?
nobody? is that mean that ACF has a bug so cannot update it?
Can you be a little clearer and give additional information on what you’re trying to do?
The first 3 statements inside of your while all appear to be updating the same field, then you are trying to use update_sub_field to update the same repeater you’re trying to loop through.