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.


Top ↑

Return

(WP_Theme|false) Object, or false if no theme is installed, which would be bad.


Top ↑

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;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.