Created
May 14, 2015 22:22
-
-
Save mgratch/d510e3a4f85675bfdf5d to your computer and use it in GitHub Desktop.
Upon entry approval (via GravityView) from form 8 or 10 entry data will be submitted to form 12.
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('gravityview/approve_entries/approved','submit_master_map_form'); | |
function submit_master_map_form($entry_id, $input_values = array()){ | |
$entry = RGFormsModel::get_lead($entry_id); | |
$form_id = $entry['form_id']; | |
if ($form_id == 8){ | |
//Select drop down option based on which form data is coming from | |
$input_values['input_15'] = 'Chapter'; | |
//Get the Chapter Name | |
$input_values['input_4'] = $entry[23]; | |
//Get the City | |
$input_values['input_2_3'] = $entry['29.3']; | |
//Get the State/Province/Region | |
$input_values['input_2_4'] = $entry['29.4']; | |
//Get the Country | |
$input_values['input_2_6'] = $entry['29.6']; | |
GFAPI::submit_form( 12, $input_values ); | |
} | |
if ($form_id == 10){ | |
$input_values['input_15'] = 'Salon'; | |
$input_values['input_4'] = $entry[42]; | |
$input_values['input_2_3'] = $entry['56.3']; | |
$input_values['input_2_4'] = $entry['56.4']; | |
$input_values['input_2_6'] = $entry['56.6']; | |
GFAPI::submit_form( 12, $input_values ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment