Feeding checkbox values from a Gravity Forms form (which creates a new post) into an Advanced Custom Fields field. I've had a read around and found some info and code snippets but nothing is working thus far
A bit more research and it looks like Gravity forms stores multi checked data, but ACF doesn't see more than the first field entry, Ive done an answer below, changing the field id to the field name does the trick as the example shows.
Removed Images, No need for them ( I've put the answer below )
Feeding checkbox values from a Gravity Forms form (which creates a new post) into an Advanced Custom Fields field. I've had a read around and found some info and code snippets but nothing is working thus far
A bit more research and it looks like Gravity forms stores multi checked data, but ACF doesn't see more than the first field entry, Ive done an answer below, changing the field id to the field name does the trick as the example shows.
Removed Images, No need for them ( I've put the answer below )
Share Improve this question edited Oct 5, 2017 at 10:25 Randomer11 asked Oct 5, 2017 at 7:53 Randomer11Randomer11 41611 silver badges31 bronze badges1 Answer
Reset to default 1Ok Figured it out with a bit of tinkering with the above. Might not be ideal but it works. If someone has a better way of doing it please feel free to chip in explaining why its better :)
$gravity_form_id = '10'; // Gravity Forms ID
add_action("gform_after_submission_$gravity_form_id", "gravity_post_submission", 10, 2);
function gravity_post_submission ($entry, $form){
$post_id = $entry["post_id"];
$values = get_post_custom_values("services_available", $post_id);
update_field("field_59d5ef43664cc", $values, $post_id);
}