diff --git src/wp-admin/network/themes.php src/wp-admin/network/themes.php
index 958bd7e..34a1a9a 100644
|
|
if ( $action ) { |
116 | 116 | exit; |
117 | 117 | } |
118 | 118 | |
119 | | $files_to_delete = $theme_info = array(); |
| 119 | $theme_info = array(); |
120 | 120 | $theme_translations = wp_get_installed_translations( 'themes' ); |
121 | 121 | foreach ( $themes as $key => $theme ) { |
122 | 122 | $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 | | } |
140 | 123 | } |
141 | 124 | |
142 | 125 | include(ABSPATH . 'wp-admin/update.php'); |
… |
… |
if ( $action ) { |
194 | 177 | <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;"> |
195 | 178 | <?php submit_button( __( 'No, return me to the theme list' ), 'button', 'submit', false ); ?> |
196 | 179 | </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> |
208 | 180 | </div> |
209 | 181 | <?php |
210 | 182 | require_once(ABSPATH . 'wp-admin/admin-footer.php'); |
diff --git src/wp-admin/plugins.php src/wp-admin/plugins.php
index 93aec79..1846445 100644
|
|
if ( $action ) { |
256 | 256 | ?> |
257 | 257 | <div class="wrap"> |
258 | 258 | <?php |
259 | | $files_to_delete = $plugin_info = array(); |
| 259 | $plugin_info = array(); |
260 | 260 | $have_non_network_plugins = false; |
261 | 261 | $plugin_translations = wp_get_installed_translations( 'plugins' ); |
262 | 262 | foreach ( (array) $plugins as $plugin ) { |
263 | 263 | $plugin_slug = dirname( $plugin ); |
264 | 264 | |
265 | 265 | if ( '.' == $plugin_slug ) { |
266 | | $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin; |
267 | 266 | if ( $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ) ) { |
268 | 267 | $plugin_info[ $plugin ] = $data; |
269 | 268 | $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); |
… |
… |
if ( $action ) { |
272 | 271 | } |
273 | 272 | } |
274 | 273 | } 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 | | |
281 | 274 | // Get plugins list from that folder. |
282 | 275 | if ( $folder_plugins = get_plugins( '/' . $plugin_slug ) ) { |
283 | 276 | foreach ( $folder_plugins as $plugin_file => $data ) { |
… |
… |
if ( $action ) { |
288 | 281 | } |
289 | 282 | } |
290 | 283 | } |
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 | | } |
301 | 284 | } |
302 | 285 | } |
303 | 286 | $plugins_to_delete = count( $plugin_info ); |
… |
… |
if ( $action ) { |
353 | 336 | <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;"> |
354 | 337 | <?php submit_button( __( 'No, return me to the plugin list' ), 'button', 'submit', false ); ?> |
355 | 338 | </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> |
367 | 339 | </div> |
368 | 340 | <?php |
369 | 341 | require_once(ABSPATH . 'wp-admin/admin-footer.php'); |