tec_tickets_wallet_plus_load()

Register and load the service provider for loading the plugin.

Contents


Source

File: src/functions/load.php

function tec_tickets_wallet_plus_load() {
	$plugin_register = tribe( \TEC\Tickets_Wallet_Plus\Plugin_Register::class );

	// Determine if the main class exists, it really shouldn't, but we double-check.
	if ( class_exists( $plugin_register->get_plugin_class(), false ) ) {
		$notice_about_plugin_already_exists = static function() {
			$message = esc_html__(
				'Tickets Wallet Plus plugin is already loaded. Please check your site for conflicting plugins.',
				'event-tickets-wallet-plus'
			);

			tec_tickets_wallet_plus_show_fail_message( $message );
		};

		// Loaded in single site or not network-activated in a multisite installation.
		add_action( 'admin_notices', $notice_about_plugin_already_exists );

		// Network-activated in a multisite installation.
		add_action( 'network_admin_notices', $notice_about_plugin_already_exists );
	}

	// Last file that needs to be loaded manually.
	require_once dirname( $plugin_register->get_base_dir() ) . '/src/Tickets_Wallet_Plus/Plugin.php';

	// Load the plugin, autoloading happens here.
	\TEC\Tickets_Wallet_Plus\Plugin::boot();
}

Top ↑

Changelog

Changelog
Version Description
1.0.0 Introduced.