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

get_theme() WordPress Function

The get_theme() function is used to retrieve the current theme's information. This function can be used to get the path of the current theme, the URI of the current theme, the current theme's parent theme, and so on.

get_theme( string $theme ) #

Retrieve theme data.


Description

Top ↑

See also


Top ↑

Parameters

$theme

(string)(Required)Theme name.


Top ↑

Return

(array|null) Null, if theme name does not exist. Theme data, if exists.


Top ↑

Source

File: wp-includes/deprecated.php

function get_theme( $theme ) {
	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme( $stylesheet )' );

	$themes = get_themes();
	if ( is_array( $themes ) && array_key_exists( $theme, $themes ) )
		return $themes[ $theme ];
	return null;
}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Use wp_get_theme()
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