WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/06/2010 08:39:50 AM (10 years ago)
Author:
dd32
Message:

First scrape at new UI for Bulk plugin upgrades. See #11232

File:
1 edited

Legend:

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

    r13590 r13602  
    352352}
    353353
    354 function do_plugin_upgrade() {
    355     if ( isset( $_GET['plugins'] ) ) {
    356         $plugins = explode( ',', $_GET['plugins'] );
    357     } elseif ( isset( $_POST['checked'] ) ) {
    358         $plugins = (array) $_POST['checked'];
    359     } else {
    360         // Nothing to do.
    361         return;
    362     }
    363 
    364     include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    365     $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode( implode( ',', $plugins ) );
    366     $title = __( 'Upgrade Plugins' );
    367     $nonce = 'upgrade-core';
    368     $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url' ) ) );
    369     $upgrader->bulk_upgrade( $plugins );
    370 }
    371 
    372354$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
    373355
     
    387369} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
    388370    check_admin_referer('upgrade-core');
     371
    389372    // do the (un)dismiss actions before headers,
    390373    // so that they can redirect
     
    392375        do_dismiss_core_update();
    393376    elseif ( isset( $_POST['undismiss'] ) )
    394     do_undismiss_core_update();
     377        do_undismiss_core_update();
     378
    395379    require_once('admin-header.php');
    396380    if ( 'do-core-reinstall' == $action )
     
    398382    else
    399383        $reinstall = false;
     384
    400385    if ( isset( $_POST['upgrade'] ) )
    401386        do_core_upgrade($reinstall);
     387
    402388} elseif ( 'do-plugin-upgrade' == $action ) {
    403389    check_admin_referer('upgrade-core');
     390
     391    if ( isset( $_GET['plugins'] ) ) {
     392        $plugins = explode( ',', $_GET['plugins'] );
     393    } elseif ( isset( $_POST['checked'] ) ) {
     394        $plugins = (array) $_POST['checked'];
     395    } else {
     396        wp_redirect('plugins.php');
     397        exit;
     398    }
     399
     400    $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
     401    $url = wp_nonce_url($url, 'bulk-update-plugins');
     402
     403    $title = __('Update Plugins');
     404
    404405    require_once('admin-header.php');
    405     do_plugin_upgrade();
     406    echo '<div class="wrap">';
     407    screen_icon('plugins');
     408    echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
     409    echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
     410    echo '</div>';
    406411}
    407412
Note: See TracChangeset for help on using the changeset viewer.