Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active September 5, 2016 04:24
Show Gist options
  • Save spivurno/d4516b2d137847b9d597 to your computer and use it in GitHub Desktop.
Save spivurno/d4516b2d137847b9d597 to your computer and use it in GitHub Desktop.
Gravity Wiz // GP Unique ID // Share a global unique ID across all forms
<?php
/**
* Gravity Wiz // GP Unique ID // Share a global unique ID across all forms
*/
add_filter( 'gpui_unique_id_attributes', 'gwiz_global_unique_id', 10, 3 );
function gwiz_global_unique_id( $atts, $form_id, $field_id ) {
if( $atts['type'] != 'sequential' ) {
$atts['form_id'] = 1;
$atts['field_id'] = 1;
}
return $atts;
}
@alexphelps
Copy link

@spivurno Does this work? I'm trying to figure out a global unique ID across multiple forms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment