WP_Theme_Install_List_Table::_get_theme_status
Checks to see if the theme is already installed.
Метод класса: WP_Theme_Install_List_Table{}
Хуков нет.
Возвращает
Строку. Theme status.
Использование
// private - только в коде основоного (родительского) класса $result = $this->_get_theme_status( $theme );
- $theme(stdClass) (обязательный)
- A WordPress.org Theme API object.
Список изменений
| С версии 3.4.0 | Введена. |
Код WP_Theme_Install_List_Table::_get_theme_status() WP Theme Install List Table:: get theme status WP 6.9.4
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;
}