Skip to content

Instantly share code, notes, and snippets.

@imknight
Last active November 22, 2017 21:29
Show Gist options
  • Save imknight/41417a196045bf444699 to your computer and use it in GitHub Desktop.
Save imknight/41417a196045bf444699 to your computer and use it in GitHub Desktop.
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