(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: https://develop.svn.wordpress.org/trunk@20039 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-02-29 19:27:54 +00:00
parent 9cc63bb04f
commit 43913e382c
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()
*/