Ticket #11850: plugins.diff
File plugins.diff, 2.3 KB (added by , 15 years ago) |
---|
-
wp-admin/plugins.php
224 224 foreach ( (array) $plugins as $plugin ) { 225 225 if ( '.' == dirname($plugin) ) { 226 226 $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin; 227 if ( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) )227 if( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) ) { 228 228 $plugin_info[ $plugin ] = $data; 229 $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); 230 } 229 231 } else { 230 232 //Locate all the files in that folder: 231 233 $files = list_files( WP_PLUGIN_DIR . '/' . dirname($plugin) ); … … 233 235 $files_to_delete = array_merge($files_to_delete, $files); 234 236 } 235 237 //Get plugins list from that folder 236 if ( $folder_plugins = get_plugins( '/' . dirname($plugin)) ) 237 $plugin_info = array_merge($plugin_info, $folder_plugins); 238 if ( $folder_plugins = get_plugins( '/' . dirname($plugin)) ) { 239 foreach( $folder_plugins as $plugin_file => $data ) { 240 $plugin_info[ $plugin_file ] = $data; 241 $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); 242 } 243 } 238 244 } 239 245 } 240 246 ?> 241 247 <p><?php _e('Deleting the selected plugins will remove the following plugin(s) and their files:'); ?></p> 242 248 <ul class="ul-disc"> 243 249 <?php 244 foreach ( $plugin_info as $plugin ) 245 /* translators: 1: plugin name, 2: plugin author */ 246 echo '<li>', sprintf(__('<strong>%1$s</strong> by <em>%2$s</em>'), $plugin['Name'], $plugin['Author']), '</li>'; 250 foreach ( $plugin_info as $plugin ) { 251 if ( $plugin['is_uninstallable'] ) 252 /* translators: 1: plugin name, 2: plugin author */ 253 echo '<li>', sprintf(__('<strong>%s</strong> by <em>%s</em> (will also <strong>delete its data</strong>)'), $plugin['Name'], $plugin['Author']), '</li>'; 254 else 255 /* translators: 1: plugin name, 2: plugin author */ 256 echo '<li>', sprintf(__('<strong>%s</strong> by <em>%s</em>'), $plugin['Name'], $plugin['Author']), '</li>'; 257 } 247 258 ?> 248 259 </ul> 249 260 <p><?php _e('Are you sure you wish to delete these files?') ?></p>