Changeset 17033
- Timestamp:
- 12/17/2010 09:53:47 PM (14 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-plugins-list-table.php
r17004 r17033 363 363 if ( current_user_can( 'manage_network_plugins' ) ) 364 364 $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 365 if ( current_user_can( 'delete_plugins') )365 if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) 366 366 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 367 367 } -
trunk/wp-admin/plugins.php
r17006 r17033 196 196 //$_POST = from the plugin form; $_GET = from the FTP details screen. 197 197 $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 198 if ( empty( $plugins ) ) { 199 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); 200 exit; 201 } 202 198 203 $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins. 199 if ( empty( $plugins) ) {200 wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s") );204 if ( empty( $plugins ) ) { 205 wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ); 201 206 exit; 202 207 } … … 331 336 <?php if ( isset($_GET['error']) ) : 332 337 333 if ( isset($_GET['charsout']) ) 338 if ( isset( $_GET['main'] ) ) 339 $errmsg = __( 'You cannot delete a plugin while it is active on the main site.' ); 340 elseif ( isset($_GET['charsout']) ) 334 341 $errmsg = sprintf(__('The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.'), $_GET['charsout']); 335 342 else … … 338 345 <div id="message" class="updated"><p><?php echo $errmsg; ?></p> 339 346 <?php 340 if ( !isset( $_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?>347 if ( !isset( $_GET['main'] ) && !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?> 341 348 <iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe> 342 349 <?php
Note: See TracChangeset
for help on using the changeset viewer.