Ticket #27201: 27201.4.diff
File 27201.4.diff, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/file.php
58 58 function get_file_description( $file ) { 59 59 global $wp_file_descriptions; 60 60 61 if ( isset( $wp_file_descriptions[basename( $file )] ) ) { 62 return $wp_file_descriptions[basename( $file )]; 63 } 64 elseif ( file_exists( $file ) && is_file( $file ) ) { 61 if ( isset( $wp_file_descriptions[ basename( $file ) ] ) && basename( dirname( dirname( $file ) ) ) == 'themes' ) { 62 return $wp_file_descriptions[basename( $file )]; 63 } elseif ( file_exists( $file ) && is_file( $file ) ) { 65 64 $template_data = implode( '', file( $file ) ); 66 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )65 if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) ) { 67 66 return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) ); 67 } 68 68 } 69 69 70 70 return trim( basename( $file ) ); -
src/wp-admin/theme-editor.php
129 129 130 130 $description = get_file_description( $file ); 131 131 $file_show = array_search( $file, array_filter( $allowed_files ) ); 132 if ( $description != $file_show ) 132 if ( $description != $file_show ) { 133 133 $description .= ' <span>(' . $file_show . ')</span>'; 134 } else { 135 $description = basename( $file ).' <span>(' . $file_show . ')</span>'; 136 } 134 137 ?> 135 138 <div class="wrap"> 136 139 <h2><?php echo esc_html( $title ); ?></h2> … … 180 183 echo "\t</ul>\n\t<h3>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h3>\n\t<ul>\n"; 181 184 182 185 $file_description = get_file_description( $absolute_filename ); 183 if ( $file_description != basename( $filename ) ) 186 if ( $file_description != basename( $filename ) ) { 187 if( basename( dirname( dirname( $absolute_filename ) ) ) !== 'themes' ) { 188 $file_description .= basename( $filename ); 189 } 184 190 $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>'; 191 } 185 192 186 if ( $absolute_filename == $file ) 193 if ( $absolute_filename == $file ) { 187 194 $file_description = '<span class="highlight">' . $file_description . '</span>'; 195 } 188 196 ?> 189 197 <li><a href="theme-editor.php?file=<?php echo urlencode( $filename ) ?>&theme=<?php echo urlencode( $stylesheet ) ?>"><?php echo $file_description; ?></a></li> 190 198 <?php