Warning: This function has been deprecated. Use wp_get_themes() instead.

get_themes() WordPress Function

The get_themes() function is used to retrieve a list of themes installed on a WordPress site. This function can be used to programmatically list all available themes, or to retrieve information about a specific theme.

get_themes() #

Retrieve list of themes with theme data in theme directory.


Description

The theme is broken, if it doesn’t have a parent theme and is missing either style.css and, or index.php. If the theme has a parent theme then it is broken, if it is missing style.css; index.php is optional.

Top ↑

See also


Top ↑

Return

(array) Theme list with theme data.


Top ↑

Source

File: wp-includes/deprecated.php

function get_themes() {
	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_themes()' );

	global $wp_themes;
	if ( isset( $wp_themes ) )
		return $wp_themes;

	$themes = wp_get_themes();
	$wp_themes = array();

	foreach ( $themes as $theme ) {
		$name = $theme->get('Name');
		if ( isset( $wp_themes[ $name ] ) )
			$wp_themes[ $name . '/' . $theme->get_stylesheet() ] = $theme;
		else
			$wp_themes[ $name ] = $theme;
	}

	return $wp_themes;
}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Use wp_get_themes()
1.5.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.

Show More