WordPress.org

Make WordPress Core

Changeset 5156


Ignore:
Timestamp:
03/31/07 20:56:54 (7 years ago)
Author:
rob1n
Message:

Deactivate All Plugins feature. fixes #3498

File:
1 edited

Legend:

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

    r4972 r5156  
    2727        do_action('deactivate_' . trim( $_GET['plugin'] )); 
    2828        wp_redirect('plugins.php?deactivate=true'); 
     29    } elseif ($_GET['action'] == 'deactivate-all') { 
     30        check_admin_referer('deactivate-all'); 
     31        $current = get_option('active_plugins'); 
     32         
     33        foreach ($current as $plugin) { 
     34            array_splice($current, array_search($plugin, $current), 1); 
     35            do_action('deactivate_' . $plugin); 
     36        } 
     37         
     38        update_option('active_plugins', array()); 
     39        wp_redirect('plugins.php?deactivate-all=true'); 
    2940    } 
    3041    exit; 
     
    6677<?php elseif ( isset($_GET['deactivate']) ) : ?> 
    6778    <div id="message" class="updated fade"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p></div> 
     79<?php elseif (isset($_GET['deactivate-all'])) : ?> 
     80    <div id="message" class="updated fade"><p><?php _e('All plugins <strong>deactivated</strong>.'); ?></p></div> 
    6881<?php endif; ?> 
    6982 
     
    136149?> 
    137150 
     151<tr> 
     152    <td colspan="5"><a href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>"><?php _e('Deactivate All Plugins'); ?></a></td> 
     153</tr> 
     154 
    138155</table> 
    139156<?php 
Note: See TracChangeset for help on using the changeset viewer.