Tribe__Tickets__Tickets::get_ticket_delete_link( object $ticket = null )
Returns the html for the delete ticket link
Contents
Parameters
- $ticket
-
(object) (Optional) Ticket object
Default value: null
Return
(string) HTML link
Source
File: src/Tribe/Tickets.php
public function get_ticket_delete_link( $ticket = null ) {
if ( empty( $ticket ) ) {
return;
}
$button_text = ( 'Tribe__Tickets__RSVP' === $ticket->provider_class ) ? __( 'Delete RSVP', 'event-tickets' ) : __( 'Delete Ticket', 'event-tickets' ) ;
/**
* Allows for the filtering and testing if a user can delete tickets
*
* @since 4.6
*
* @param bool true
* @param int ticket post ID
* @return string HTML link | void HTML link
*/
if ( apply_filters( 'tribe_tickets_current_user_can_delete_ticket', true, $ticket->ID, $ticket->provider_class ) ) {
$delete_link = sprintf(
'<span><a href="#" attr-provider="%1$s" attr-ticket-id="%2$s" id="ticket_delete_%2$s" class="ticket_delete">%3$s</a></span>',
$ticket->provider_class,
$ticket->ID,
esc_html( $button_text )
);
return $delete_link;
}
$delete_link = sprintf(
'<span><a href="#" attr-provider="%1$s" attr-ticket-id="%2$s" id="ticket_delete_%2$s" class="ticket_delete">%3$s</a></span>',
$ticket->provider_class,
$ticket->ID,
esc_html__( $button_text )
);
return $delete_link;
}
Changelog
| Version | Description |
|---|---|
| 4.6 | Introduced. |