Skip to content

Instantly share code, notes, and snippets.

@rafsuntaskin
Created September 6, 2023 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafsuntaskin/21d99444ca3a945073c33c337ce11287 to your computer and use it in GitHub Desktop.
Save rafsuntaskin/21d99444ca3a945073c33c337ce11287 to your computer and use it in GitHub Desktop.
Create attendee by ticket id
<?php
$ticket_id = 999;
$provider = tribe_tickets_get_ticket_provider( $ticket_id );
$attendee_data = [
'title' => 'Generated Attendee 1',
'full_name' => 'A test attendee',
'email' => 'attendee@test.com',
];
$provider->create_attendee( $ticket_id, $attendee_data );
// you can see the supported $attendee_data args from RSVP here: https://github.com/the-events-calendar/event-tickets/blob/b658848be64daaa886f91b271b566dfec11c026a/src/Tribe/RSVP.php#L873-L889
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment