I need to add data to a repeater field in a custom post type programatically. What I did is add all the needed meta fields, BUT it does not create the required reference meta fields, so I cannot use the API to get the data in the front-end. Obviously, It’ll add the references if I just save the post from the back end, but that’s not acceptable for my application. How can I add all the references correctly (So I wouldn’t have to manually click save in the admin)?
Hi @dror
Please use the update_field function (docs available) to save the repeater field value.
The value saved should be a multi-dimensional array containing rows of data, where each row is an array containing the field_name => field_value relatinoship.
Does that help?
Thanks
E