Posted: March 5, 2015 at 9:04 am
|
I read in this forum https://eventespresso.com/topic/event-specific-attendee-id-number/ the same problem that I have. I need a unique, consecutive numeric ID that automatically populates for each attendee for event. are there any solution yet? WP version: 4.1 |
Hello, Try this sample coding: https://gist.github.com/Apina/d0ce690b8af1cad64135 It can be added to your child theme’s functions.php file (do not include the opening php tag) or a site specific plugin: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ — |
|
|
This code does’t work, fatal error in a site specific plugin, I think there is something wrong in the code. And I need consecutive numeric ID, and I think this code give a numeric random ID
|
|
Are there any way to assign consecutive ID numbers to attendees in each event? |
|
Hi, Yep that code was very broken, not sure how that happened. I’ve updated the code, plus updated the filter: https://gist.github.com/Apina/d0ce690b8af1cad64135 The only way to assign consecutive ID’s would be to store the data somewhere. One way would be to add a custom meta field to the event, check for it in the function, update it by one, use it in the ID, then update the new figure back in the custom meta field. This has the advantage of being event specific. If you needed something more site wide, you could do something similar but use a WP option instead. Useful PHP snippets: https://eventespresso.com/wiki/useful-php-code-snippets/ |
|
Thanks, the code now works perfect, but i don’t know how to do a custom field that auto-increment in each attendee. I think this could be very useful for many people that use event espresso for sport events. |
|
Hi, I added another example to the above Gist. It still will have issues due to registration abandonment, but it’s a basic example of how to achieve incremental reg id’s. If you need it taking further, I would recommend contacting a PHP developer for assistance. |
The support post ‘Consecutive Numeric ID for each attendee’ 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.