Module::save_ticket( int $post_id, Tribe__Tickets__Ticket_Object $ticket, array $raw_data = array() )
Saves a Tickets Commerce ticket.
Contents
Parameters
- $post_id
-
(int) (Required) Post ID.
- $ticket
-
(Tribe__Tickets__Ticket_Object) (Required) Ticket object.
- $raw_data
-
(array) (Optional) Ticket data.
Default value: array()
Return
(int|false) The updated/created ticket post ID or false if no ticket ID.
Source
File: src/Tickets/Commerce/Module.php
public function save_ticket( $post_id, $ticket, $raw_data = [] ) {
// Run anything we might need on parent method.
parent::save_ticket( $post_id, $ticket, $raw_data );
/**
* 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.
*/
return tribe( Ticket::class )->save( $post_id, $ticket, $raw_data );
}
Changelog
| Version | Description |
|---|---|
| 5.1.9 | Introduced. |