LLMS_Add_On::is_installed()

Determine if the add-on is currently installed


Return Return

(bool)


Top ↑

Source Source

File: includes/models/model.llms.add-on.php

	public function is_installed() {

		if ( ! $this->is_installable() ) {
			return false;
		}

		$type = $this->get_type();

		if ( 'plugin' === $type ) {
			return in_array( $this->get( 'update_file' ), array_keys( get_plugins() ), true );
		} elseif ( 'theme' === $type ) {
			return wp_get_theme( $this->get( 'update_file' ) )->exists();
		}

		return false;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.21.3 Use strict comparison for in_array().
3.22.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.