Skip to content

Commit 7bf3599

Browse files
authored
gpuid-shared-sequences.php: Updated to use the new slug attribute.
1 parent 0b7b0fb commit 7bf3599

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

gp-unique-id/gpuid-shared-sequences.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
* )
1717
* );
1818
*/
19-
add_filter( 'gpui_unique_id_attributes', 'gwiz_unique_id_global_sequential_index', 10, 3 );
20-
21-
function gwiz_unique_id_global_sequential_index( $atts, $form_id, $field_id ) {
19+
add_filter( 'gpui_unique_id_attributes', function ( $atts, $form_id, $field_id ) {
2220

2321
$groups = array(
2422
array(
@@ -31,7 +29,7 @@ function gwiz_unique_id_global_sequential_index( $atts, $form_id, $field_id ) {
3129
),
3230
);
3331

34-
if ( $atts['type'] != 'sequential' ) {
32+
if ( $atts['type'] !== 'sequential' ) {
3533
return $atts;
3634
}
3735

@@ -50,10 +48,15 @@ function gwiz_unique_id_global_sequential_index( $atts, $form_id, $field_id ) {
5048
return $atts;
5149
}
5250

53-
$atts['starting_number'] = 1;
54-
$atts['form_id'] = 0;
55-
$atts['original_form_id'] = $form_id;
56-
$atts['field_id'] = $group_number;
51+
$atts['starting_number'] = 1;
52+
53+
$atts['slug'] = array(
54+
'form_id' => 0,
55+
'field_id' => 0,
56+
'slug' => 'shared-sequence-' . $group_number,
57+
);
5758

5859
return $atts;
59-
}
60+
}, 10, 3 );
61+
62+

0 commit comments

Comments
 (0)