Hi there
I did a search and read the update_field documentation but i’m a little confused.
I basically just want to be able to update a post’s repeater data from my template files.
So i have a post (ID 512) which has a repeater called ‘users’ which has ‘name’, ‘surname’, telephone’ text fields.
I looked in the DB and these are stored as documented so:
udetails_1_name – ‘dave’
_udetails_1_name – ‘field_532b122e8afe1’
udetails_2_name – ‘mark’
_udetails_2_name – ‘field_532b122e8afe1’
etc…
My question is how do i use the update_field function to say change dave’s name to ‘paul’ or remove mark all together (along with his second name and telephone).
I am confused as to how the function:
update_field($field_key, $value, $post_id)
How the field key in this case is the same for both ‘rows’ so if i did:
update_field(‘field_532b122e8afe1’, ‘whatever’, 512)
this does not target any of the repeater’s data rows specifically.
Also how would you go about deleting a row from the front end or adding one in? I could do it manually i guess with SQL but maintaining the correct sequence of:
udetails_1_name
udetails_2_name
udetails_3_name
etc will be tricky and i’d rather use your inbuilt functions…. just totally stuck as to how to go about it.
thanks