Forked from spivurno/gp-unique-id-prepend-date-to-unique-id.php
Created
September 5, 2016 04:09
-
-
Save phillipwilhelm/11b48fb9e86a83f82a2e9b1bbb86b944 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