Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // v 0.3 Revised January 9, 2013
- // http://www.gravityhelp.com/forums/topic/change-option-value?replies=19#post-103945
- // this code will apply to form 1 only
- add_action('gform_pre_submission_filter_260', 'strip_pricing_again');
- function strip_pricing_again($form) {
- $field_pair = array('input_1' => 'input_57', // envia el Desayuno elegido al ZOHO
- 'input_2' => 'input_58', // envia el Nº de personas al ZOHO
- 'input_55' => 'input_59', // envia los extras al ZOHO
- 'input_27' => 'input_60', // envia forma de pago al ZOHO
- 'input_52' => 'input_61'); // envia la población al ZOHO
- // define the separator
- $needle = '|';
- // loop through all the field pairs
- // the unmodified value is stored in $_POST[$original]
- // and after modification it will be assigned to $_POST[$hidden]
- foreach ($field_pair as $original => $hidden) {
- $haystack = $_POST[$original];
- $result = substr($haystack, 0, strpos($haystack, $needle));
- $_POST[$hidden] = $result;
- }
- // return the form
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement