Divi::is_divi_active()


Source

File: src/Tribe/Editor/Compatibility/Divi.php

	public static function is_divi_active() {
		/** @var Tribe__Cache $cache */
		$cache = tribe( 'cache' );

		$divi = $cache->get( 'is_divi' );

		if ( false !== $divi ) {
			// Stored as an int - convert to a boolean.
			return (bool) $divi;
		}

		// OK, do it the hard way.
		$theme = wp_get_theme();
		// Handle theme children and variations.
		$divi = 'Divi' == $theme->name || 'Divi' == $theme->template || 'Divi' == $theme->parent_theme;

		// Cache to save us this work next time.
		$cache->set( 'is_divi', (int) $divi, Tribe__Cache::NON_PERSISTENT, Tribe__Cache_Listener::TRIGGER_UPDATED_OPTION );

		// Stored as an int - convert to a boolean.
		return (bool) $divi;
	}