Skip to content

Commit

Permalink
gpuid-sequence-by-nested-forms-parent-entry.php: Added new snippet.
Browse files Browse the repository at this point in the history
  • Loading branch information
spivurno authored Oct 23, 2023
1 parent f8c4389 commit 62b384a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gp-unique-id/gpuid-sequence-by-nested-forms-parent-entry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Gravity Perks // Unique ID // Unique Sequences by Nested Forms Parent Entry
* https://gravitywiz.com/documentation/gravity-forms-unique-id/
*/
// Update "123" to your child form ID and "4" to your Unique ID field ID.
add_filter( 'gpui_unique_id_attributes_123_4', function ( $atts, $form_id, $field_id ) {

// Update "5" to the ID of the field on your child form that is capturing the Nested Forms session hash.
$session_hash = rgpost( 'input_5' );
if ( empty( $session_hash ) ) {
return $atts;
}

$atts['slug'] = "gpnf-session-hash-{$session_hash}";

return $atts;
}, 10, 3 );

0 comments on commit 62b384a

Please sign in to comment.