WP_Theme_Install_List_Table::_get_theme_status() – Check to see if the theme is already installed.

You appear to be a bot. Output may be restricted

Description

Check to see if the theme is already installed.

Usage

$string = WP_Theme_Install_List_Table::_get_theme_status( $theme );

Parameters

$theme
( stdClass ) required – A WordPress.org Theme API object.

Returns

string Theme status.

Source

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

1 to 16 of 16
  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;
  }
 

 View on GitHub View on Trac