$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Gravity Forum Custom Field Check box attribution|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Gravity Forum Custom Field Check box attribution

matteradmin9PV0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

Ok 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);

}

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far