<?php
/**
* GP Unique ID // Gravity Perks // Date-specific Sequences
* http://gravitywiz.com/
*
* Requirements:
* - Your form ID cannot be more than 3 digits.
* - Your field ID cannot be more than 2 digits.
*/
// Update "123" to your form ID. Update "4" to your Unique ID field ID.
add_filter( 'gpui_unique_id_attributes_123_4', function( $atts, $form_id, $field_id ) {
// Generates a unique sequence identifier based on current date.
$atts['form_id'] = date( 'mdy' );
// Add additional support for uniquely identifying this sequence by form and field.
$atts['field_id'] = substr( $form_id, 0, 3 ) . substr( $field_id, 0, 2 );
return $atts;
}, 10, 3 );