WP_Theme::get_core_default_theme() WordPress Method
The WP_Theme::get_core_default_theme() method is used to get the default WordPress theme. This theme is used when a user first installs WordPress and is the fallback theme if a theme is not active.
WP_Theme::get_core_default_theme() #
Determines the latest WordPress default theme that is installed.
Description
This hits the filesystem.
Return
(WP_Theme|false) Object, or false if no theme is installed, which would be bad.
Source
File: wp-includes/class-wp-theme.php
public static function get_core_default_theme() {
foreach ( array_reverse( self::$default_themes ) as $slug => $name ) {
$theme = wp_get_theme( $slug );
if ( $theme->exists() ) {
return $theme;
}
}
return false;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |