Ticket #27201: 27201-3.patch
File 27201-3.patch, 2.2 KB (added by , 11 years ago) |
---|
-
includes/file.php
53 53 * @uses _cleanup_header_comment 54 54 * @uses $wp_file_descriptions 55 55 * @param string $file Filesystem path or filename 56 * @return string Description of file from $wp_file_descriptions o r basename of $file if description doesn't exist56 * @return string Description of file from $wp_file_descriptions only for top level directory files of themes for others empty string or basename of $file if description doesn't exist 57 57 */ 58 58 function get_file_description( $file ) { 59 59 global $wp_file_descriptions; 60 60 61 61 if ( isset( $wp_file_descriptions[basename( $file )] ) ) { 62 return $wp_file_descriptions[basename( $file )]; 62 if( basename( dirname( dirname( $file ) ) ) == 'themes'){ 63 return $wp_file_descriptions[basename( $file )]; 64 } 65 return ''; 63 66 } 64 67 elseif ( file_exists( $file ) && is_file( $file ) ) { 65 68 $template_data = implode( '', file( $file ) ); … … 1108 1111 </form> 1109 1112 <?php 1110 1113 return false; 1111 } 1114 } 1115 No newline at end of file -
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 && basename( dirname( dirname( $file ) ) ) == 'themes' ) { 133 133 $description .= ' <span>(' . $file_show . ')</span>'; 134 } 135 else { 136 $description = basename( $file ).' <span>(' . $file_show . ')</span>'; 137 } 134 138 ?> 135 139 <div class="wrap"> 136 140 <h2><?php echo esc_html( $title ); ?></h2> … … 180 184 echo "\t</ul>\n\t<h3>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h3>\n\t<ul>\n"; 181 185 182 186 $file_description = get_file_description( $absolute_filename ); 187 183 188 if ( $file_description != basename( $filename ) ) 189 if( basename( dirname( dirname( $absolute_filename ) ) ) !== 'themes' ){ 190 $file_description .= basename( $filename ); 191 } 184 192 $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>'; 185 193 186 194 if ( $absolute_filename == $file )