Created
January 23, 2015 18:24
-
-
Save spivurno/5df371f4b3c34115cb77 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Unique ID // Prepend Date to Unique ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Perks // GP Unique ID // Prepend Date to Unique ID | |
*/ | |
add_filter( 'gpui_unique_id', 'add_date_to_unique_id', 10, 3 ); | |
function add_date_to_unique_id( $unique, $form_id, $field_id ) { | |
if( $form_id == 1 && $field_id == 2 ) { | |
// if $unique was "123", this would change it do something like "01132015_123" | |
$unique .= date( 'mdy' ) . '_' . $unique; | |
} | |
return $unique; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment