(ACF PRO LATEST VERSION)
Hello,
I have a field group with a textbox (record_date) and a repeater (daily_record) in it.
On the front end, I can display everything fine in a table and edit the repeater fields no problem with a modal popup.
What I would like to do is where it says “BTN HERE” on the right side next to each row from the repeater (in the table), have an edit button to popup a similar modal with acf_form() but to edit JUST THAT ROW.
I can’t figure out how to segregate that row. I tried using the FIELDS option in ACF_FORM() but couldn’t get it to work with the repeater.
I know it has something to do with telling which row in the array to use, but can’t get that far…
I can grab the row number (0,1,2,3 etc) using a FOR loop for my repeater, but don’t know how to tell the acf_form to load just that row.
$records = get_field('daily_record');
// loop through repeater
if( $records):
foreach( $records as $i => $row ):
Any help would be appreciated!
Thanks!
Hi @teamawesome
I’m afraid acf_form() doesn’t have that kind of feature. If you want to do it, you need to create your own form and handler, then use the update_sub_field() function to update the row. Unfortunately, this needs an advanced code. I suggest you hire a developer to help you out with it, and I’d recommend looking for one on https://studio.envato.com/ or https://www.upwork.com/. I’m sorry for the inconvenience.
Thanks 🙂