tribe_events_community_tickets_init()

Topics


Source #

File: events-community-tickets.php

function tribe_events_community_tickets_init() {
	$classes_exist	= class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Community__Tickets__Main' );
	$plugin_check 	= tribe_check_plugin( 'Tribe__Events__Community__Tickets__Main' );
	$version_ok    	= $classes_exist && $plugin_check;

	if ( class_exists( 'Tribe__Main' ) && ! is_admin() && ! class_exists( 'Tribe__Events__Community__Tickets__PUE__Helper' ) ) {
		tribe_main_pue_helper();
	}

	if ( ! $version_ok ) {
		// if we have the plugin register the dependency check will handle the messages
		if ( class_exists( 'Tribe__Abstract_Plugin_Register' ) ) {
			new Tribe__Events__Community__Tickets__PUE( __FILE__ );

			return;
		}

		add_action( 'admin_notices', 'tribe_show_community_tickets_fail_message' );
		add_action( 'network_admin_notices', 'tribe_show_community_tickets_fail_message' );

		return;
	}

	Tribe__Events__Community__Tickets__Main::instance();
}