Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WordPress Gravity Form Save Custom Meta Field for Advanced Custom Fields
add_action("gform_after_submission_1", "acf_post_submission", 10, 2);
function acf_post_submission ($entry, $form)
{
$post_id = $entry["post_id"];
update_field('address1', $entry['29.1'], $post_id);
update_field('address2', $entry['29.2'], $post_id);
update_field('address3', $entry['29.3'], $post_id);
}
add_action("gform_after_submission_1", "acf_post_submission", 10, 2);
function acf_post_submission ($entry, $form)
{
$post_id = $entry["post_id"];
update_post_meta($post_id,'address1', $entry['29.1']);
update_post_meta($post_id,'address2', $entry['29.2']);
update_post_meta($post_id,'city', $entry['29.3']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment