I have some code like this
$form_names = GFFormsModel::get_forms();
foreach ($form_names as $form) {
add_action("gform_pre_submission_".$form->id, "format_ecp_event_meta_from_gravity");
function format_ecp_event_meta_from_gravity(){
}
}
Since i'm using foreach loop functions get duplicated. So is there a way to make the function unique using $form->id ?
I mean i want the function names like this
function format_ecp_event_meta_from_gravity_{$form->id}(){
}
Can someone help me? Thanks