I got some custom code working allright with a filter,
but now I only want it to work on form number 1.
So I added this to the theme's functions.php:
add_action("gform_pre_submission_filter", "update_autoresponder");
if($form['id'] != 1) return $form; //only use on form1 else return
function update_autoresponder($form) {
do something
}
// return the modified form
return $form;
}
The code should thus only run on form1, but instead it is also run on form2, form3 etc.
Next, for debug purposes, I changed the code to the following for debug purposes:
add_action("gform_pre_submission_filter", "update_autoresponder");
if($form['id'] != 1) return $form; //only use on form1 else return
function update_autoresponder($form) {
return $form; // <-- added new line, to stop processing rest of the code regardless of $form['id']
do something
}
// return the modified form
return $form;
}
This did indeed result in the added custom code to be skipped.
Next I tried switching back from 1.5RC4 to 1.4,
and I used the orignial code, as posted above here.
And things worked as expexted as well, only performing the custom code for form 1.
I cant figure out what is wrong here... but Im beginning to think that the $form object, or the $form['id'] array is not globally available in 1.5RC4.
Any help would be much appreciated.
Site URL + admin login available on request per email (mailaddress filled out in my profile)