Created
November 2, 2016 23:54
-
-
Save Idealien/8208012c41add2323b5f743e4125a3de to your computer and use it in GitHub Desktop.
WP Gravity Flow Bulk Creation for Import Plugin Processing
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 | |
//replace ## with your form ID - and also update field IDs with your appropriate numbers. | |
add_action( "gform_pre_submission_##", "employee_lookup_and_assignment", 10, 1 ); | |
function employee_lookup_and_assignment( $form ) { | |
$reviewer = get_user_by( 'email', rgpost( 'input_12' )); | |
if( $reviewer ): | |
$_POST['input_10'] = "user_id|" . $reviewer->ID; | |
endif; | |
$employee = get_user_by( 'email', rgpost( 'input_13' ) ); | |
if( $employee ): | |
$_POST['input_11'] = $employee->ID; | |
$userMetaExample = get_user_meta($employee->ID, 'user_meta_example', true); | |
if( $userMetaExample ): | |
$_POST['input_14'] = $userMetaExample; | |
endif; | |
endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment