Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_Theme_Install_List_Table::_get_theme_status() WordPress Method

The WP_Theme_Install_List_Table::_get_theme_status() method is used to get the status of a theme. This is used to determine if a theme is installed, update, or broken.

WP_Theme_Install_List_Table::_get_theme_status( stdClass $theme ) #

Check to see if the theme is already installed.


Parameters

$theme

(stdClass)(Required)A WordPress.org Theme API object.


Top ↑

Return

(string) Theme status.


Top ↑

Source

File: wp-admin/includes/class-wp-theme-install-list-table.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.