Support

Home Forums Event Espresso Premium Pass the event id to stripe

Pass the event id to stripe

Posted: May 14, 2021 at 3:09 am


Embercombe

May 14, 2021 at 3:09 am

Hi Im struggling to return the event id to stripe as part of the description. I’m repurposing some code i found here which works with a custom field. I understand that the event id is the same as the post id but im hoping i can just use the value of the event id in the code

$desc .= ' | event code: ' . get_post_meta($event->id(), 'event_code', true);
$stripe_data['description'] = $desc;

This works fine to output my custom event code field. Any ideas how i can just output the event (or post id)?


Tony

  • Support Staff

May 14, 2021 at 4:16 am

Hi there,

How are you trying to pass the event id?

In the above, $event->ID() gives you the event ID but how do you want to include it?

$desc .= ' | event code: ' . get_post_meta($event->ID(), 'event_code', true);

That is adding | event code: {event_custom_code} to the end of the description.

If you just want that to be the Event ID you could do something like:

$desc .= ' | event id: ' . $event->ID();

The support post ‘Pass the event id to stripe’ 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