WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/17/2010 11:21:15 PM (8 years ago)
Author:
nacin
Message:

Network Admin: Show a warning when deleting non-network-only plugins, as they may be activated on subsites. fixes #15709.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/plugins.php

    r17033 r17036  
    218218                <?php
    219219                    $files_to_delete = $plugin_info = array();
     220                    $have_non_network_plugins = false;
    220221                    foreach ( (array) $plugins as $plugin ) {
    221222                        if ( '.' == dirname($plugin) ) {
     
    224225                                $plugin_info[ $plugin ] = $data;
    225226                                $plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
     227                                if ( ! $plugin_info[ $plugin ]['Network'] )
     228                                    $have_non_network_plugins = true;
    226229                            }
    227230                        } else {
     
    236239                                    $plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data );
    237240                                    $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
     241                                    if ( ! $plugin_info[ $plugin_file ]['Network'] )
     242                                        $have_non_network_plugins = true;
    238243                                }
    239244                            }
     
    244249                    echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>';
    245250                ?>
     251                <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
     252                <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This plugin may be active on other sites in the network.', 'These plugins may be active on other sites in the network.', $plugins_to_delete ); ?></p></div>
     253                <?php endif; ?>
    246254                <p><?php echo _n( 'You are about to remove the following plugin:', 'You are about to remove the following plugins:', $plugins_to_delete ); ?></p>
    247255                    <ul class="ul-disc">
Note: See TracChangeset for help on using the changeset viewer.