Changeset 20315 for trunk/wp-admin/theme-editor.php
- Timestamp:
- 03/29/2012 04:16:17 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/theme-editor.php
r20314 r20315 56 56 57 57 $allowed_files = $theme->get_files( 'php', 1 ); 58 $has_templates = ! empty( $allowed_files ); 59 58 60 $style_files = $theme->get_files( 'css' ); 59 61 if ( isset( $style_files['style.css'] ) ) { … … 133 135 134 136 $description = get_file_description( $file ); 135 $file_show = array_search( $file, $allowed_files);137 $file_show = array_search( $file, array_filter( $allowed_files ) ); 136 138 if ( $description != $file_show ) 137 139 $description .= ' <span>(' . $file_show . ')</span>'; … … 143 145 <div class="fileedit-sub"> 144 146 <div class="alignleft"> 145 <h3><?php echo $theme->display('Name') .': ' . $description; ?></h3>147 <h3><?php echo $theme->display('Name'); if ( $description ) echo ': ' . $description; ?></h3> 146 148 </div> 147 149 <div class="alignright"> … … 150 152 <select name="theme" id="theme"> 151 153 <?php 152 foreach ( wp_get_themes( ) as $a_stylesheet => $a_theme ) {154 foreach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) { 153 155 $selected = $a_stylesheet == $stylesheet ? ' selected="selected"' : ''; 154 156 echo "\n\t" . '<option value="' . esc_attr( $a_stylesheet ) . '"' . $selected . '>' . $a_theme->display('Name') . '</option>'; … … 163 165 <div id="templateside"> 164 166 <?php 165 if ( $allowed_files ) : 167 if ( array_filter( $allowed_files ) ) : 168 if ( $has_templates || $theme->is_child_theme() ) : 166 169 ?> 167 170 <h3><?php _e('Templates'); ?></h3> … … 171 174 <ul> 172 175 <?php 176 endif; 177 173 178 foreach ( $allowed_files as $filename => $absolute_filename ) : 174 179 if ( 'style.css' == $filename ) {
Note: See TracChangeset
for help on using the changeset viewer.