Last active
November 22, 2017 21:29
-
-
Save imknight/41417a196045bf444699 to your computer and use it in GitHub Desktop.
WordPress Gravity Form Save Custom Meta Field for Advanced Custom Fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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