admin管理员组文章数量:1130349
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);
}
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);
}
本文标签: Gravity Forum Custom Field Check box attribution
版权声明:本文标题:Gravity Forum Custom Field Check box attribution 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749125632a2319734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论