(string) WP_Theme is now the theme name, translated. Good replacement for get_current_theme(); better than wp_get_theme()->display('Name'). see #20103, see #20138.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-02-29 19:27:54 +00:00
parent 966a27513f
commit bf97881f98
2 changed files with 10 additions and 1 deletions

View File

@ -314,7 +314,7 @@ function twentyeleven_theme_options_render_page() {
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), get_current_theme() ); ?></h2>
<h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), wp_get_theme() ); ?></h2>
<?php settings_errors(); ?>
<form method="post" action="options.php">

View File

@ -238,6 +238,15 @@ final class WP_Theme implements ArrayAccess {
}
}
/**
* When converting the object to a string, the theme name is returned.
*
* @return string Theme name, ready for display (translated)
*/
function __toString() {
return (string) $this->display('Name');
}
/**
* __isset() magic method for properties formerly returned by current_theme_info()
*/