Tribe__Events__Community__Tickets__Main::can_delete_existing_ticket( bool $can_delete, int $ticket_id )

Filters the user’s ability to delete existing tickets.

The default behavior is to disallow deletion of tickets once sales have been made. This can be overridden via the following filter hook, which this callback itself runs on:




(bool) (Required) Whether user is able to delete existing tickets before applying this function's logic.


(int) (Required) The Ticket's Post ID.

Top ↑


(bool) Whether user is able to delete existing tickets after applying this function's logic.

Top ↑


File: src/Tribe/Main.php

	public function can_delete_existing_ticket( $can_delete, $ticket_id ) {
		$event = tribe_events_get_ticket_event( $ticket_id );
		if ( tribe_community_events_is_community_event( $event ) ) {
			$total_sales = get_post_meta( $ticket_id, 'total_sales', true );

			if ( $total_sales ) {
				return false;

		return $can_delete;