Hi,
I have a repeater on my front-end form, is it possible to pre-populate the first row within acf_form’s new_post array? This is what I’ve tried:
'new_post' => array(
'post_type' => 'mycpt',
'post_status' => 'publish',
'users' => 1,
'users_0_user_email' => $user->user_email,
)
Minimum rows is set to 1. Doesn’t work but I’m not sure if any ACF field can be pre-populated this way or not, or if it’s just default WP fields that can be.
You need to use the update_field() function. http://www.advancedcustomfields.com/resources/update_field/
There are details on updating a repeater. It is for a taxonomy, but it will work on a post as well, just use the posts ID.
YOu will need to do this in a pre save post filter, this is explained here http://www.advancedcustomfields.com/resources/acf-pre_save_post/
Thanks John, much appreciated.