Tribe__Tickets__Tickets_View::get_tickets_page_url( int $event_id )

Helper function to generate the Link to the tickets page of an event.


Parameters

$event_id

(int) (Required) event_id The Event ID we're checking.


Top ↑

Return

(string) The URL to the tickets page.


Top ↑

Source

File: src/Tribe/Tickets_View.php

	public function get_tickets_page_url( $event_id, $is_event_page ) {
		$has_plain_permalink = '' === get_option( 'permalink_structure' );
		$event_url = get_permalink( $event_id );

		// Is on the Event post type
		if ( $is_event_page ) {
			$link = $has_plain_permalink
				? add_query_arg( 'eventDisplay', 'tickets', untrailingslashit( $event_url ) )
				: trailingslashit( $event_url ) . 'tickets';
		} else {
			$link = $has_plain_permalink
				? add_query_arg( 'tribe-edit-orders', 1, untrailingslashit( $event_url ) )
				: home_url( '/tickets/' . $event_id );
		}
		return $link;
	}

Top ↑

Changelog

Changelog
Version Description
5.8.2 Removed the $is_event_page param.
4.7.1 Introduced.