Tribe__Tickets__Main::maybe_bail_if_old_tec_is_present()
Prevents bootstrapping and autoloading if the version of TEC that is running is too old
Source
File: src/Tribe/Main.php
public function maybe_bail_if_old_tec_is_present() {
// early check for an older version of The Events Calendar to prevent fatal error
if ( ! class_exists( 'Tribe__Events__Main' ) ) {
return;
}
if ( version_compare( Tribe__Events__Main::VERSION, $this->min_tec_version, '>=' ) ) {
return;
}
$this->should_prevent_autoload_init = true;
add_action( 'admin_notices', [ $this, 'tec_compatibility_notice' ] );
add_action( 'network_admin_notices', [ $this, 'tec_compatibility_notice' ] );
add_action( 'tribe_plugins_loaded', [ $this, 'remove_exts' ], 0 );
/*
* After common was loaded by another source (e.g. The Events Calendar) let's append this plugin source files
* to the ones the Autoloader will search. Since we're appending them the ones registered by the plugin
* "owning" common will be searched first.
*/
add_action( 'tribe_common_loaded', [ $this, 'register_plugin_autoload_paths' ] );
// if we get in here, we need to reset the global common to TEC's version so that we don't cause a fatal
$this->reset_common_lib_info_back_to_tec();
}
Changelog
| Version | Description |
|---|---|
| 5.9.3 | added boolean "invalid" return value. True if the check fails, false if it passes. |
| 4.10.6.2 | Introduced. |