Tribe__Events__Community__Tickets__Main::should_run()

Should the plugin run? Are all of the appropriate items in place?

Topics


Source #

File: src/Tribe/Main.php

	public function should_run() {
		foreach ( $this->get_requisite_plugins() as $plugin ) {
			if ( ! class_exists( $plugin['class'] ) ) {
				return false;
			}

			if ( ! isset( $plugin['min_version'] ) || ! isset( $plugin['ver_compare'] ) ) {
				continue;
			}

			$active_version = constant( $plugin['ver_compare'] );

			if ( null === $active_version ) {
				return false;
			}

			if ( version_compare( $active_version, $plugin['min_version'], '<' ) ) {
				return false;
			}
		}

		return true;
	}