Good Morning,
I hope someone can help point out probably the glaringly obvious!
I have some code which I know works to add a row into a repeater field on a user (user meta):
$row = array(
'field_595ceca2bddf1' => $job_id,
'field_595cecbabddf2' => $job_title
);
$i = add_row('field_595cec87bddf0', $row, $user_id);
This works great when used with the acf/save_post function.
I therefore created an ajax script which is to do the same sort of thing.
When I test the ajax script with a single text field added to a user, it works perfectly fine when using the following in the ajax callback function:
update_user_meta( $user_id, 'test_field', $job_title ); # Update our user meta
So I know the callback works, it’s grabbing the values etc.
However, if I swap this over to:
# Insert data into the repeater
$row = array(
'field_595ceca2bddf1' => $job_id,
'field_595cecbabddf2' => $job_title
);
$i = add_row('field_595cec87bddf0', $row, $user_id);
It simply doesn’t add the row to the user repeater field.
Unless I’m missing something, I honestly can’t see why?
Any help is much appreciated!
Thanks in advanced.