Skip to content

Commit c25f0e2

Browse files
committed
gpui-sequential-ids-as-per-date-field.php: Added snippet to generate Unique IDs as per selected date field.
1 parent 2e5d3f7 commit c25f0e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gp-unique-id/gpui-sequential-ids-as-per-date-field.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
*/
99
// Update "123" to your form ID and "4" to your Unique ID field.
1010
add_filter( 'gpui_unique_id_attributes_123_4', 'gw_generate_unique_id_as_per_date_field', 10, 4);
11-
function gw_generate_unique_id_as_per_date_field( $atts, $entry, $form_id, $field_id ) {
12-
// Replace 4 with the Date field ID used for targetting Unique ID generation
13-
$date_field_id = 4;
11+
function gw_generate_unique_id_as_per_date_field( $atts, $form_id, $field_id, $entry ) {
12+
// Replace 5 with the Date field ID used for targetting Unique ID generation
13+
$date_field_id = 5;
1414

1515
// Remove any special character like / - . which can be in the date field value.
1616
$date_string = str_replace( array( '/', '-', '.' ), '', $entry[$date_field_id] );

0 commit comments

Comments
 (0)