spivurno
7/14/2016 - 11:39 PM

Gravity Perks // GP Unique ID // Reverse Sequential Unique ID

Gravity Perks // GP Unique ID // Reverse Sequential Unique ID

<?php
/**
 * Gravity Perks // GP Unique ID // Reverse Sequential Unique ID
 * http://gravitywiz.com/documentation/gp-unique-id/
 */
add_action( 'gpui_unique_id', function( $unique, $form_id, $field_id ) {
	// update "519" to the ID of your form, update "7" to the ID of your Unique ID field
	if( $form_id == 519 && $field_id == 7 ) {
		$starting_number = 201; // update to the number at which the sequential ID should start
		$unique = $starting_number - intval( $unique );
	}
	return $unique;
}, 10, 3 );