尝试使用gform_entry_id_pre_save_lead更新重力形式的条目 没有更新。多个字段
我已经测试了$ _POST数据,并且其中包含我想要的数据
add_filter( 'gform_entry_id_pre_save_lead_15', 'my_update_entry_on_form_submission', 10, 2 );
function my_update_entry_on_form_submission( $entry_id, $form ) {
// Get entris from register to class form and from add student to class form
$r = 5;
$a = 12;
$form_5 = GFAPI::get_entries($r);
$form_12 = GFAPI::get_entries($a);
// Marege the two entries to one array
$marged_entries = array_merge($form_5, $form_12);
// Get the student id
$student_id = $form["fields"][9]["defaultValue"];
// get the currect entry id
foreach ($marged_entries as $entry) {
if ($entry["post_id"] == $student_id) {
$entry_id = $entry['id'];
$update_entry_id = rgpost( 'input_13' );
echo '<pre>';
print_r( $_POST );
echo '</pre>';
}
}
return $update_entry_id ? $update_entry_id : $entry_id;
}