Make WordPress Core


Ignore:
Timestamp:
09/28/2015 03:10:08 AM (10 years ago)
Author:
wonderboymusic
Message:

Theme Editor: ensure that files named index.php in theme subfolders are not labeled as "Main Index Template"

Props MikeHansenMe, wonderboymusic, bravokeyl, Shelob9.
Fixes #27201.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-editor.php

    r34066 r34658  
    2626'content'   =>
    2727    '<p>' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '</p>
    28     <p>' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '</p>
     28    <p>' . __("Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of the theme's template files. Clicking once on any file name causes the file to appear in the large Editor box.") . '</p>
    2929    <p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.') . '</p>
    3030    <p id="newcontent-description">' . __( 'In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.' ) . '</p>
     
    126126<?php endif;
    127127
    128 $description = get_file_description( $file );
     128$description = get_file_description( $relative_file );
    129129$file_show = array_search( $file, array_filter( $allowed_files ) );
    130130if ( $description != $file_show )
     
    178178            echo "\t</ul>\n\t<h2>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h2>\n\t<ul>\n";
    179179
    180         $file_description = get_file_description( $absolute_filename );
    181         if ( $file_description != basename( $filename ) )
     180        $file_description = get_file_description( $filename );
     181        if ( $filename !== basename( $absolute_filename ) || $file_description !== $filename ) {
    182182            $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';
    183 
    184         if ( $absolute_filename == $file )
     183        }
     184
     185        if ( $absolute_filename === $file ) {
    185186            $file_description = '<span class="highlight">' . $file_description . '</span>';
     187        }
    186188?>
    187189        <li><a href="theme-editor.php?file=<?php echo urlencode( $filename ) ?>&amp;theme=<?php echo urlencode( $stylesheet ) ?>"><?php echo $file_description; ?></a></li>
Note: See TracChangeset for help on using the changeset viewer.