Module::delete_ticket( $event_id, $ticket_id )
Deletes a ticket or an attendee post.
Contents
Parameters
- $event_id
-
(Required)
- $ticket_id
-
(Required)
Return
(bool)
Source
File: src/Tickets/Commerce/Module.php
public function delete_ticket( $event_id, $ticket_id ) {
/**
* Important, do not add anything above this method.
* Our goal is to reduce the amount of load on the `Module`, relegate these behaviors to the correct models.
*/
$deleted = tribe( Ticket::class )->delete( $event_id, $ticket_id );
if ( ! $deleted ) {
return $deleted;
}
// Run anything we might need on parent method.
parent::delete_ticket( $event_id, $ticket_id );
return $deleted;
}
Changelog
| Version | Description |
|---|---|
| 5.5.10 | Adjust the method to handle both Ticket and Attendee post type deletion separately. |
| 5.1.9 | Introduced. |