Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created November 24, 2023 14:11
Show Gist options
  • Save Pebblo/5672298dc0ae3eff641b00034a6163be to your computer and use it in GitHub Desktop.
Save Pebblo/5672298dc0ae3eff641b00034a6163be to your computer and use it in GitHub Desktop.
Example of how to change the REG Code generated within Event Espresso 4+
<?php //Do not include the opening PHP tag if you already have one
function tw_ee_add_year_prefix_to_reg_code($reg_code, $transaction, $ticket) {
// Add a date prefix using 'C{year}-'
$prefix = 'C' . date("y") . '-';
//Return $reg_code
return $prefix . $reg_code;
}
add_filter('FHEE__Create__regCode__new_reg_code', 'tw_ee_add_year_prefix_to_reg_code', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment