This solution is not working for me. In fact, it is creating error messages; “An Error Occurred, No ID”. Perhaps I am doing something wrong. All I want is a five digit random ticket number rather than what is generated by EE. I have added the blocks of code to functions.php as suggested here: https://eventespresso.com/topic/custom-registration-id/ and this is where the problems began – error messages. Can someone please give better instructions? Thank you.
add_filter('filter_hook_espresso_registration_id', 'my_custom_registration_id', 10, 1);
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 substr(strtr($id, 'abcdefghi', '01234567890j'), 0, 5);
}
// 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 );
Try adding this code to this blank plugin to hold the custom functions.
The support post ‘Ticket Numbers’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.