Another new addition to 3.4 is the deprecation of the get_theme_data function, this function was used pull data from the header of a theme’s stylesheet. This function was useful for outputting theme data in a repeatable way. The new function wp_get_theme is the replacement for this function. The difference is that the get_theme_data returned data in an array and the data was accessible via array keys, while wp_get_theme returns the data as an object. This has little effect on how the code is used just how to retrieve the data.
Maintaining backwards compatibility is always a top priority when releasing a theme for the public. This code below will accomplish this by testing if the new function exists before running it, and falling back to the old function if it doesn’t. The same variables are used for either way, so they variables can be used regardless of what function is used.

By Jacob Coens June 15, 2012 - 7:17 am
Thanks Jeremy,
The following also works and is a little more compact. Also, note that the properties for theme and author uri have different names between get_theme_data and wp_get_theme.
ThemeURI;
$author_uri = $theme_data->Author_URI;
} else {
$theme_data = (object) get_theme_data(get_template_directory() . ‘/style.css’);
$theme_uri = $theme_data->URI;
$author_uri = $theme_data->AuthorURI;
}
$version = $theme_data->Version;
$name = $theme_data->Name;
$description = $theme_data->Description;
$author = $theme_data->Author;
//If theme is child theme this is the name of the parent theme
$template = $theme_data->Template;
$tags = $theme_data->Tags;
?>
By Jacob Coens June 15, 2012 - 7:18 am
The code doesn’t show properly, here it is again:
$theme_data;
if (function_exists(‘wp_get_theme’)){
$theme_data = wp_get_theme(‘theme-name’);
$theme_uri = $theme_data->ThemeURI;
$author_uri = $theme_data->Author_URI;
} else {
$theme_data = (object) get_theme_data(get_template_directory() . ‘/style.css’);
$theme_uri = $theme_data->URI;
$author_uri = $theme_data->AuthorURI;
}
$version = $theme_data->Version;
$name = $theme_data->Name;
$description = $theme_data->Description;
$author = $theme_data->Author;
//If theme is child theme this is the name of the parent theme
$template = $theme_data->Template;
$tags = $theme_data->Tags;
By Jeremy Clark June 15, 2012 - 8:31 am
Very nice, I’ll update the code.