Support

Home Forums Event Espresso Premium How do I get the unique event identifier after event confirmation?

How do I get the unique event identifier after event confirmation?

Posted: October 16, 2012 at 10:19 am

Viewing 7 reply threads


Noah Purves-Smith

October 16, 2012 at 10:19 am

I am able to get the event ID from the $data_soure array, but I can’t figure out how to get the unique event identifier. I’m trying to create a link back to the event post, and I wanted to use the unique event identifier to create it. If I could get the post URL, that would work too. Anyone know how to do this?


Chris Reynolds

  • Support Staff

October 16, 2012 at 2:30 pm

Why do you need the unique event identifier instead of the event_id? Event Espresso urls are typically in this format: yourdomain.com/event-registration/?ee=<event_id>.


Noah Purves-Smith

October 16, 2012 at 2:59 pm

I want the URL for the event post, not the registration post. Does that make sense?

The URL .../blog/events/email-test/ has a unique event identifier that is something like email-test-34567890-1-45678. It then has a registration link that goes to ../event-registration/?ee=...

I was hoping to grab the URL with regex from the unique event identifier, unless there’s an easier way to link back to the post, and not the registration page.


Chris Reynolds

  • Support Staff

November 4, 2012 at 9:21 am

Hi Noah —

Sorry about the delay in the response.

I want the URL for the event post, not the registration post. Does that make sense?

No, that doesn’t make sense. Are you using custom post types? If so, AFAIK, the slug comes from the event name, not the unique event identifier. The unique event identifier is really only used when you’re using the single event shortcode. In 3.2 we’re using “pretty” permalinks and that will behave more like a regular post slug, but right now that unique event identifier isn’t used for much beyond the shortcode. Everything uses the event ID.


Noah Purves-Smith

November 8, 2012 at 1:00 pm

Hi Chris:

I’ll show you an example. Here’s a page that uses the EVENT_LIST shortcode:

http://ravissustainable.net/courses-events/

The links go to the registration pages. The Edmonton one on the list (EVENT_LIST), should match the Edmonton one on the right (Event Espresso Upcoming Events Widget), which goes to the event post.

I was just wondering what code I could use to create links to events posts, instead of event registration pages.

Hope that makes more sense. 🙂


Chris Reynolds

  • Support Staff

November 9, 2012 at 10:56 am

You need to not be using EVENT_LIST if you’re using custom post types. You should be using the page-event_list.php template in the post-type-samples directory which displays all the espresso event posts. Note: you’ll need to modify the template to match your theme’s markup/layout.

The only other workaround you could do is set an alternate registration URL to the event post, but you’d need to do it on every single event.


Noah Purves-Smith

November 9, 2012 at 11:37 am

@Chris I got it to work by adding the variable get_permalink($event->post_id) to event_list.php and changing $registration_url to this variable in event_list_display.php. I guess the programmer before me already had this added to the widget.php.

Thanks!


Chris Reynolds

  • Support Staff

November 12, 2012 at 4:36 pm

Thanks. I’ll have to test that. Glad you got it working.

Viewing 7 reply threads

The support post ‘How do I get the unique event identifier after event confirmation?’ 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.

Event Espresso