File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1717 // Update "1" to any field ID from your child form and "Second Choice" the value that should be saved to this field.
1818 '1 ' => 'Second Choice ' ,
1919 // Update "2" to another field ID in your child field and "Second" to the value that should be saved to it.
20- '2 ' => ' Second ' ,
20+ '2 ' => time () ,
2121 // Add as many "field ID" => "value" pairs as required.
2222 ), $ parent_form ['id ' ] );
2323
2424 $ session = new GPNF_Session ( $ parent_form ['id ' ] );
25+
26+ // Attach new child entry to the session.
2527 $ session ->add_child_entry ( $ child_entry_id );
2628
29+ // Get all entry IDs from the session and return them.
30+ $ session_entry_ids = $ session ->get ( 'nested_entries ' );
31+ if ( ! empty ( $ session_entry_ids [ $ nested_form_field ->id ] ) ) {
32+ $ entry_ids = $ session_entry_ids [ $ nested_form_field ->id ];
33+ }
34+
2735 return $ entry_ids ;
2836}, 10 , 3 );
2937
You can’t perform that action at this time.
0 commit comments