Controller::render_ticket_edit_controls( Tribe__Tickets__Ticket_Object $ticket, int|null $post_id = null )
Render the ticket edit controls for the ticket list table.
Contents
Parameters
- $ticket
-
(Tribe__Tickets__Ticket_Object) (Required) The ticket object.
- $post_id
-
(int|null) (Optional) The ID of the post context of the print.
Default value: null
Source
File: src/Tickets/Blocks/Controller.php
public function render_ticket_edit_controls( Ticket_Object $ticket, int $post_id = null ): void {
if ( $ticket->get_event_id() !== $post_id ) {
// If the ticket is not associated with the current post, don't render the controls.
return;
}
/** @var Admin_Views $admin_views */
$admin_views = tribe( 'tickets.admin.views' );
$show_duplicate_button = ! function_exists( 'tribe_is_community_edit_event_page' )
|| ! tribe_is_community_edit_event_page();
$admin_views->template( 'editor/list-row/edit', [
'ticket' => $ticket,
'show_duplicate_button' => $show_duplicate_button,
] );
}
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |