View difference between Paste ID: nurw2KMy and pJZ2Ex9Z
SHOW: | | - or go back to the newest paste.
1
// v 0.3 Revised January 9, 2013
2
// http://www.gravityhelp.com/forums/topic/change-option-value?replies=19#post-103945
3-
add_action('gform_pre_submission_filter_1', 'strip_pricing');
3+
4-
function strip_pricing($form) {
4+
add_action('gform_pre_submission_filter_260', 'strip_pricing_again');
5-
		$field_pair = array('input_1' => 'input_57',	// envia el Desayuno elegido al ZOHO
5+
function strip_pricing_again($form) {
6-
							'input_2' => 'input_58',	// envia el Nº de personas  al ZOHO
6+
        $field_pair = array('input_1' => 'input_57',    // envia el Desayuno elegido al ZOHO
7-
							'input55' => 'input_59',	// envia los extras al ZOHO
7+
                            'input_2' => 'input_58',    // envia el Nº de personas  al ZOHO
8-
							'input_27' => 'input_60',	// envia forma de pago al ZOHO
8+
                            'input_55' => 'input_59',   // envia los extras al ZOHO
9-
							'input_52' => 'input_61');	// envia la población al ZOHO
9+
                            'input_27' => 'input_60',   // envia forma de pago al ZOHO
10-
							
10+
                            'input_52' => 'input_61');  // envia la población al ZOHO
11-
		// define the separator one time
11+
12-
		$needle   = '|';
12+
        // define the separator
13-
		
13+
        $needle   = '|';
14-
		// loop through all the field pairs
14+
15-
		// the unmodified value is stored in $_POST[$original]
15+
        // loop through all the field pairs
16-
		// and after modification it will be assigned to $_POST[$hidden]
16+
        // the unmodified value is stored in $_POST[$original]
17-
		foreach ($array as $original => $hidden) {
17+
        // and after modification it will be assigned to $_POST[$hidden]
18-
			$haystack = $_POST[$original];
18+
        foreach ($field_pair as $original => $hidden) {
19-
			$result = substr($haystack, 0, strpos($haystack, $needle));
19+
            $haystack = $_POST[$original];
20-
			$_POST[$hidden] = $result;
20+
            $result = substr($haystack, 0, strpos($haystack, $needle));
21-
		}
21+
            $_POST[$hidden] = $result;
22
        }
23-
		// return the form
23+
24-
		return $form;
24+
        // return the form
25
        return $form;
26
}