Changeset 13470 for trunk/wp-admin/plugins.php
- Timestamp:
- 02/27/2010 10:01:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/plugins.php
r13452 r13470 223 223 ?> 224 224 <div class="wrap"> 225 <h2><?php _e('Delete Plugin(s)'); ?></h2>226 225 <?php 227 226 $files_to_delete = $plugin_info = array(); … … 229 228 if ( '.' == dirname($plugin) ) { 230 229 $files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin; 231 if ( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) )230 if( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) ) { 232 231 $plugin_info[ $plugin ] = $data; 232 $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); 233 } 233 234 } else { 234 235 //Locate all the files in that folder: … … 238 239 } 239 240 //Get plugins list from that folder 240 if ( $folder_plugins = get_plugins( '/' . dirname($plugin)) ) 241 $plugin_info = array_merge($plugin_info, $folder_plugins); 241 if ( $folder_plugins = get_plugins( '/' . dirname($plugin)) ) { 242 foreach( $folder_plugins as $plugin_file => $data ) { 243 $plugin_info[ $plugin_file ] = $data; 244 $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); 245 } 246 } 242 247 } 243 248 } 249 screen_icon(); 250 $plugins_to_delete = count( $plugin_info ); 251 echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>'; 244 252 ?> 245 <p><?php _e('Deleting the selected plugins will remove the following plugin(s) and their files:'); ?></p>253 <p><?php echo _n( 'Deleting the selected plugin will remove the following plugin and its files:', 'Deleting the selected plugins will remove the following plugins and their files:', $plugins_to_delete ); ?></p> 246 254 <ul class="ul-disc"> 247 255 <?php 248 foreach ( $plugin_info as $plugin ) 249 /* translators: 1: plugin name, 2: plugin author */ 250 echo '<li>', sprintf(__('<strong>%1$s</strong> by <em>%2$s</em>'), $plugin['Name'], $plugin['Author']), '</li>'; 256 $data_to_delete = false; 257 foreach ( $plugin_info as $plugin ) { 258 if ( $plugin['is_uninstallable'] ) { 259 /* translators: 1: plugin name, 2: plugin author */ 260 echo '<li>', sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)' ), $plugin['Name'], $plugin['Author'] ), '</li>'; 261 $data_to_delete = true; 262 } else { 263 /* translators: 1: plugin name, 2: plugin author */ 264 echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), $plugin['Name'], $plugin['Author'] ), '</li>'; 265 } 266 } 251 267 ?> 252 268 </ul> 253 <p><?php _e('Are you sure you wish to delete these files?') ?></p> 269 <p><?php 270 if ( $data_to_delete ) 271 _e('Are you sure you wish to delete these files and data?'); 272 else 273 _e('Are you sure you wish to delete these files?'); 274 ?></p> 254 275 <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;"> 255 276 <input type="hidden" name="verify-delete" value="1" /> … … 260 281 ?> 261 282 <?php wp_nonce_field('bulk-manage-plugins') ?> 262 <input type="submit" name="submit" value="<?php esc_attr_e('Yes, Delete these files') ?>" class="button" />283 <input type="submit" name="submit" value="<?php $data_to_delete ? esc_attr_e('Yes, Delete these files and data') : esc_attr_e('Yes, Delete these files') ?>" class="button" /> 263 284 </form> 264 285 <form method="post" action="<?php echo esc_url(wp_get_referer()); ?>" style="display:inline;">
Note: See TracChangeset
for help on using the changeset viewer.