This should be simple... I'm trying to grab the form ID on the current page using gform_pre_render and then based on the form ID within the function gform_pre_render is calling do some work... (I don't always know which form is going to be loaded on the page) - so here's the simple version of the code:
$i_this_form_id = add_filter("gform_pre_render", "update_the_fields");
echo $i_this_form_id;
function update_the_fields ($form){
return $form["id"];
}
The thing is - no matter what I do or don't do with the gform_pre_render - it just puts a whole bunch of " Invalid argument supplied for foreach()" errors on my form. BUT the echo in there returns the correct form ID.
Is there a better way to make the determination of which form loaded on a page by ID so I can then run the correct gform_field_value_* operation on the form? This seems to work but there's all those errors where the form goes - why?