tribe_events_virtual_preload()

Register and load the service provider for loading the plugin.

The function will detect the presence of Common and TEC and decline to load if not found.


Return #

(bool) Whether the plugin did load successfully or not.


Top ↑

Source #

File: src/functions/load.php

function tribe_events_virtual_preload() {
	if ( ! (
		function_exists( 'tribe_register_provider' )
		&& class_exists( 'Tribe__Abstract_Plugin_Register' )
	) ) {
		// Loaded in single site or not network-activated in a multisite installation.
		add_action( 'admin_notices', 'tribe_events_virtual_show_fail_message' );
		// Network-activated in a multisite installation.
		add_action( 'network_admin_notices', 'tribe_events_virtual_show_fail_message' );
		// Prevent loading of the plugin if common is loaded (better safe than sorry).
		remove_action( 'tribe_common_loaded', 'tribe_events_virtual_load' );

		return false;
	}

	return true;
}

Top ↑

Changelog #

Changelog
Version Description
1.0.0 Introduced.