On this page
WP_Theme::get_core_default_theme(): WP_Theme|false
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. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_get_theme() wp-includes/theme.php | Gets a WP_Theme object for a theme. |
Used By
| Used By | Description |
|---|---|
| WP_Site_Health::get_test_theme_version() wp-admin/includes/class-wp-site-health.php | Tests if themes are outdated, or unnecessary. |
| populate_network_meta() wp-admin/includes/schema.php | Creates WordPress network meta and sets the default values. |
| populate_options() wp-admin/includes/schema.php | Create WordPress options and set the default values. |
| validate_current_theme() wp-includes/theme.php | Checks that the active theme has the required files. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme/get_core_default_theme