Skip to content

Instantly share code, notes, and snippets.

@Apina

Apina/EE reg id Secret

Last active December 19, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Apina/63f02bc54967dace5dc0 to your computer and use it in GitHub Desktop.
Save Apina/63f02bc54967dace5dc0 to your computer and use it in GitHub Desktop.
Remove the Registration ID and replace it with a custom one
//This goes in the custon files add on
// remove default registration id filter
function my_remove_registration_id_filter() {
remove_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id', 10);
}
add_filter ('filter_hook_espresso_registration_id', 'my_remove_registration_id_filter', 9 );
function my_custom_registration_id(){
$id = uniqid();
// for the sake of an example, we'll convert the unique ID to be letters from the alphabet, which would make for something similar to an airline's reservation code
return strtr($id, '01234567890', 'abcdefghij');
}
add_filter('filter_hook_espresso_registration_id', 'my_custom_registration_id', 10, 1);
// If you are running Ticketing you will need to edit the ticket functions.php file as well, approx line 126
//Make sure we have attendee data
if ($attendee_id=="0" || $registration_id=="0" || (!is_string($registration_id)))
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment