WP_Theme_Install_List_Table::_get_theme_status( stdClass $theme ): string
- Since
- 3.4.0
- Source
wp-admin/includes/class-wp-theme-install-list-table.php:555
Checks to see if the theme is already installed.
Parameters
$themestdClass- A WordPress.org Theme API object.
Return
string- Theme status.
Uses · 1
- wp_get_theme()Gets a WP_Theme object for a theme.
Used by · 2
- WP_Theme_Install_List_Table::install_theme_info()Prints the info for a theme (to be used in the theme installer modal).
- WP_Theme_Install_List_Table::single_row()Prints a theme from the WordPress.org API.
Source
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; }History
Introduced in 3.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-admin/includes/class-wp-theme-install-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.