Uses
Uses | Description |
---|---|
wp-includes/theme.php: wp_get_theme() | Gets a WP_Theme object for a theme. |
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.
Check to see if the theme is already installed.
(object) (Required) - A WordPress.org Theme API object.
(string) Theme status.
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; }
Version | Description |
---|---|
3.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_install_list_table/_get_theme_status