Tribe__Events__Main::maybe_bail_if_old_et_is_present()
Prevents bootstrapping and autoloading if the version of ET that is running is too old
Source
File: src/Tribe/Main.php
public function maybe_bail_if_old_et_is_present() {
// early check for an older version of Event Tickets to prevent fatal error
if ( ! class_exists( 'Tribe__Tickets__Main' ) ) {
return;
}
if ( version_compare( Tribe__Tickets__Main::VERSION, $this->min_et_version, '>=' ) ) {
return;
}
$this->should_prevent_autoload_init = true;
add_action( 'admin_notices', [ $this, 'compatibility_notice' ] );
add_action( 'network_admin_notices', [ $this, 'compatibility_notice' ] );
add_filter( 'tribe_ecp_to_run_or_not_to_run', [ $this, 'disable_pro' ] );
add_action( 'tribe_plugins_loaded', [ $this, 'remove_exts' ], 0 );
/*
* After common was loaded by another source (e.g. Event Tickets) 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 ET's version so that we don't cause a fatal
$this->reset_common_lib_info_back_to_et();
// Disable older versions of Community Events to prevent fatal Error.
remove_action( 'plugins_loaded', 'Tribe_CE_Load', 2 );
}
Changelog
| Version | Description |
|---|---|
| 4.9.3.2 | Introduced. |