Hooks
Class Hooks.
Source
File: src/Common/Event_Automator/Hooks.php
class Hooks extends \tad_DI52_ServiceProvider {
/**
* Binds and sets up implementations.
*
* @since 1.2.0
*/
public function register() {
$this->container->singleton( static::class, $this );
add_action( 'admin_init', [ $this, 'run_updates' ], 10, 0 );
}
/**
* Run Updates on Plugin Upgrades.
*
* @since 1.2.0
*/
public function run_updates() {
if ( ! class_exists( 'Tribe__Events__Updater' ) ) {
return; // Core needs to be updated for compatibility.
}
$updater = new Updater( Plugin::VERSION );
$updater->run_updates();
}
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |
Methods
- admin_register — Register providers at admin_init, so dependencies are loaded.
- register — Binds and sets up implementations.
- run_updates — Run Updates on Plugin Upgrades.