On this page
get_theme( string $theme ): array|null
This function has been deprecated. Use wp_get_theme() instead.
Retrieve theme data.
Description
See also
Parameters
$themestring Required-
Theme name.
Return
array|null Null, if theme name does not exist. Theme data, if exists.
Source
File: wp-includes/deprecated.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| get_themes() wp-includes/deprecated.php | Retrieve list of themes with theme data in theme directory. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Use wp_get_theme() |
| 1.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_theme