Make WordPress Core

Ticket #34439: 34439.3.patch

File 34439.3.patch, 4.4 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/network/themes.php

    diff --git src/wp-admin/network/themes.php src/wp-admin/network/themes.php
    index 958bd7e..34a1a9a 100644
    if ( $action ) { 
    116116                                exit;
    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
    142125                        include(ABSPATH . 'wp-admin/update.php');
    if ( $action ) { 
    194177                                <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
    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
    210182                                require_once(ABSPATH . 'wp-admin/admin-footer.php');
  • src/wp-admin/plugins.php

    diff --git src/wp-admin/plugins.php src/wp-admin/plugins.php
    index 93aec79..1846445 100644
    if ( $action ) { 
    256256                                ?>
    257257                        <div class="wrap">
    258258                                <?php
    259                                         $files_to_delete = $plugin_info = array();
     259                                        $plugin_info = array();
    260260                                        $have_non_network_plugins = false;
    261261                                        $plugin_translations = wp_get_installed_translations( 'plugins' );
    262262                                        foreach ( (array) $plugins as $plugin ) {
    263263                                                $plugin_slug = dirname( $plugin );
    264264
    265265                                                if ( '.' == $plugin_slug ) {
    266                                                         $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin;
    267266                                                        if ( $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ) {
    268267                                                                $plugin_info[ $plugin ] = $data;
    269268                                                                $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
    if ( $action ) { 
    272271                                                                }
    273272                                                        }
    274273                                                } else {
    275                                                         // Locate all the files in that folder.
    276                                                         $files = list_files( WP_PLUGIN_DIR . '/' . $plugin_slug );
    277                                                         if ( $files ) {
    278                                                                 $files_to_delete = array_merge( $files_to_delete, $files );
    279                                                         }
    280 
    281274                                                        // Get plugins list from that folder.
    282275                                                        if ( $folder_plugins = get_plugins( '/' . $plugin_slug ) ) {
    283276                                                                foreach ( $folder_plugins as $plugin_file => $data ) {
    if ( $action ) { 
    288281                                                                        }
    289282                                                                }
    290283                                                        }
    291 
    292                                                         // Add translation files.
    293                                                         if ( ! empty( $plugin_translations[ $plugin_slug ] ) ) {
    294                                                                 $translations = $plugin_translations[ $plugin_slug ];
    295 
    296                                                                 foreach ( $translations as $translation => $data ) {
    297                                                                         $files_to_delete[] = $plugin_slug . '-' . $translation . '.po';
    298                                                                         $files_to_delete[] = $plugin_slug . '-' . $translation . '.mo';
    299                                                                 }
    300                                                         }
    301284                                                }
    302285                                        }
    303286                                        $plugins_to_delete = count( $plugin_info );
    if ( $action ) { 
    353336                                <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
    354337                                        <?php submit_button( __( 'No, return me to the plugin list' ), 'button', 'submit', false ); ?>
    355338                                </form>
    356 
    357                                 <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>
    358                                 <div id="files-list" style="display:none;">
    359                                         <ul class="code">
    360                                         <?php
    361                                                 foreach ( (array) $files_to_delete as $file ) {
    362                                                         echo '<li>' . esc_html( str_replace( WP_PLUGIN_DIR, '', $file ) ) . '</li>';
    363                                                 }
    364                                         ?>
    365                                         </ul>
    366                                 </div>
    367339                        </div>
    368340                                <?php
    369341                                require_once(ABSPATH . 'wp-admin/admin-footer.php');