WP_Theme_Install_List_Table::_get_theme_status()privateWP 3.4.0

Check to see if the theme is already installed.

Method of the class: WP_Theme_Install_List_Table{}

No Hooks.

Return

String. Theme status.

Usage

// private - for code of main (parent) class only
$result = $this->_get_theme_status( $theme );
$theme(stdClass) (required)
A WordPress.org Theme API object.

Changelog

Since 3.4.0 Introduced.

WP_Theme_Install_List_Table::_get_theme_status() code WP 6.1.1

private function _get_theme_status( $theme ) {
	$status = 'install';

	$installed_theme = wp_get_theme( $theme->slug );
	if ( $installed_theme->exists() ) {
		if ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '=' ) ) {
			$status = 'latest_installed';
		} elseif ( version_compare( $installed_theme->get( 'Version' ), $theme->version, '>' ) ) {
			$status = 'newer_installed';
		} else {
			$status = 'update_available';
		}
	}

	return $status;
}