Tribe__Tickets__Editor__Template__Overwrite::has_tickets_support( $post_id )

Check if the post / event has support tickets and has tickets available


Parameters

$post_id

(Required)


Top ↑

Return

(bool)


Top ↑

Source

File: src/Tribe/Editor/Template/Overwrite.php

	public function has_tickets_support( $post_id ) {
		$post_type = get_post_type( $post_id );

		if ( ! tribe_tickets_post_type_enabled( $post_type ) ) {
			return false;
		}

		//  User is currently viewing/editing their existing tickets.
		if ( Tribe__Tickets__Tickets_View::instance()->is_edit_page() ) {
			return false;
		}

		// if there aren't any tickets, bail
		$tickets = Tribe__Tickets__Tickets::get_event_tickets( $post_id );

		return ! empty( $tickets );
	}

Top ↑

Changelog

Changelog
Version Description
4.9 Introduced.