Make WordPress Core

Changeset 35996


Ignore:
Timestamp:
12/17/2015 06:34:21 PM (11 years ago)
Author:
swissspidy
Message:

Network Admin: Remove the list of files which will be deleted when deleting a theme.

Fixes #34439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/themes.php

    r34912 r35996  
    117117                        }
    118118
    119                         $files_to_delete = $theme_info = array();
     119                        $theme_info = array();
    120120                        $theme_translations = wp_get_installed_translations( 'themes' );
    121121                        foreach ( $themes as $key => $theme ) {
    122122                                $theme_info[ $theme ] = wp_get_theme( $theme );
    123 
    124                                 // Locate all the files in that folder.
    125                                 $files = list_files( $theme_info[ $theme ]->get_stylesheet_directory() );
    126                                 if ( $files ) {
    127                                         $files_to_delete = array_merge( $files_to_delete, $files );
    128                                 }
    129 
    130                                 // Add translation files.
    131                                 $theme_slug = $theme_info[ $theme ]->get_stylesheet();
    132                                 if ( ! empty( $theme_translations[ $theme_slug ] ) ) {
    133                                         $translations = $theme_translations[ $theme_slug ];
    134 
    135                                         foreach ( $translations as $translation => $data ) {
    136                                                 $files_to_delete[] = $theme_slug . '-' . $translation . '.po';
    137                                                 $files_to_delete[] = $theme_slug . '-' . $translation . '.mo';
    138                                         }
    139                                 }
    140123                        }
    141124
     
    195178                                        <?php submit_button( __( 'No, return me to the theme list' ), 'button', 'submit', false ); ?>
    196179                                </form>
    197 
    198                                 <p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p>
    199                                 <div id="files-list" style="display:none;">
    200                                         <ul class="code">
    201                                         <?php
    202                                                 foreach ( (array) $files_to_delete as $file ) {
    203                                                         echo '<li>' . esc_html( str_replace( WP_CONTENT_DIR . '/themes', '', $file ) ) . '</li>';
    204                                                 }
    205                                         ?>
    206                                         </ul>
    207                                 </div>
    208180                        </div>
    209181                                <?php
Note: See TracChangeset for help on using the changeset viewer.