Make WordPress Core


Ignore:
Timestamp:
10/23/2009 09:49:12 PM (16 years ago)
Author:
ryan
Message:

Plugin bulk upgrade rough in. see #10973

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/update-core.php

    r12093 r12097  
    286286}
    287287
     288function no_update_actions($actions) {
     289    return '';
     290}
     291
    288292function do_plugin_upgrade() {
    289293    include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    290294
    291     $plugins = (array) $_POST['checked'];
    292     $url = 'update-core.php';
    293 
    294     foreach ( $plugins as $plugin ) {
    295         $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
    296         $upgrader->upgrade($plugin);       
    297     }
     295    if ( isset($_GET['plugins']) ) {
     296        $plugins = explode(',', $_GET['plugins']);
     297    } else {
     298        $plugins = (array) $_POST['checked'];
     299    }
     300    $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins));
     301    $title = __('Upgrade Plugins');
     302    $nonce = 'upgrade-core';
     303    add_filter('update_plugin_complete_actions', 'no_update_actions');
     304
     305    $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
     306    $upgrader->bulk_upgrade($plugins);
    298307}
    299308
Note: See TracChangeset for help on using the changeset viewer.