Tribe__Tickets__Tickets_View::hook()

Hook the necessary filters and Actions!

Contents


Return

(self)


Top ↑

Source

File: src/Tribe/Tickets_View.php

	public static function hook() {
		$myself = self::instance();

		add_action( 'template_redirect', array( $myself, 'authorization_redirect' ) );
		add_action( 'template_redirect', array( $myself, 'update_tickets' ) );

		// Generate Non TEC Permalink
		add_action( 'generate_rewrite_rules', array( $myself, 'add_non_event_permalinks' ) );
		add_filter( 'query_vars', array( $myself, 'add_query_vars' ) );
		add_action( 'parse_request', array( $myself, 'prevent_page_redirect' ) );
		add_filter( 'the_content', array( $myself, 'intercept_content' ) );
		add_action( 'parse_request', array( $myself, 'maybe_regenerate_rewrite_rules' ) );

		// Only Applies this to TEC users
		if ( class_exists( 'Tribe__Events__Rewrite' ) ) {
			add_action( 'tribe_events_pre_rewrite', array( $myself, 'add_permalink' ) );
			add_filter( 'tribe_events_rewrite_base_slugs', array( $myself, 'add_rewrite_base_slug' ) );
		}

		// Intercept Template file for Tickets
		add_action( 'tribe_events_pre_get_posts', array( $myself, 'modify_ticket_display_query' ) );
		add_filter( 'tribe_events_template', array( $myself, 'intercept_template' ), 20, 2 );

		// We will inject on the Priority 4, to be happen before RSVP
		add_action( 'tribe_events_single_event_after_the_meta', array( $myself, 'inject_link_template' ), 4 );
		add_filter( 'the_content', array( $myself, 'inject_link_template_the_content' ), 9 );

		return $myself;
	}