On display, replace an empty Theme Name with the theme's directory. see #20103.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-03-07 23:56:35 +00:00
parent 6d7522917d
commit e59777059b

View File

@ -510,10 +510,8 @@ final class WP_Theme implements ArrayAccess {
*/
public function display( $header, $markup = true, $translate = true ) {
$value = $this->get( $header );
if ( false === $value || '' === $value )
return $value;
if ( ! $this->load_textdomain() )
if ( empty( $value ) || ! $this->load_textdomain() )
$translate = false;
if ( $translate )
@ -586,6 +584,10 @@ final class WP_Theme implements ArrayAccess {
*/
private function markup_header( $header, $value, $translate ) {
switch ( $header ) {
case 'Name' :
if ( empty( $value ) )
$value = $this->get_stylesheet();
break;
case 'Description' :
$value = wptexturize( $value );
break;