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();
	}
}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

Methods