Created
December 20, 2016 19:19
-
-
Save leepettijohn/0ad94f877a87e2dec4b51222fbc29443 to your computer and use it in GitHub Desktop.
Update Custom Field after Gravity Form Submission
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
<?php /* *** Change form id on next line *** */ | |
add_action( 'gform_after_submission_10', 'update_wdi_approved', 10, 2 ); | |
function update_wdi_approved( $entry, $form ) { | |
/* *** Get the field result *** */ | |
$get_title = rgar($entry,'1'); | |
$get_wdi_date = rgar($entry,'2'); | |
/* *** Get the custom post type 'clip_order' id *** */ | |
$orderid = get_page_by_title($get_title,'OBJECT','clip_order'); | |
/* *** Update the custom field in that post *** */ | |
update_post_meta($orderid->ID,'wdi_approval_date',$get_wdi_date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment