Make WordPress Core

Changeset 12093


Ignore:
Timestamp:
10/22/2009 09:06:33 PM (15 years ago)
Author:
ryan
Message:

GUU UI rough in. see #10973

File:
1 edited

Legend:

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

    r12087 r12093  
    137137    if ( empty($plugins) )
    138138        return;
    139     $form_action = '';
     139    $form_action = 'update-core.php?action=do-plugin-upgrade';
    140140    ?>
    141141<h3><?php _e('Plugins'); ?></h3>
    142 <form method="post" action="<?php $form_action; ?>" name="upgrade-plugins" class="upgrade">
     142<p><?php _e('The following plugins have new versions available.  Check the ones you want to upgrade and then click "Upgrade Plugins".'); ?><p>
     143<form method="post" action="<?php echo $form_action; ?>" name="upgrade-plugins" class="upgrade">
    143144<?php wp_nonce_field('upgrade-core'); ?>
    144145<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Upgrade Plugins'); ?>" name="upgrade" /></p>
     
    285286}
    286287
     288function do_plugin_upgrade() {
     289    include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     290
     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    }
     298}
     299
    287300$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
     301
     302$title = __('Upgrade WordPress');
     303$parent_file = 'tools.php';
    288304
    289305if ( 'upgrade-core' == $action ) {
    290306    wp_version_check();
    291     $title = __('Upgrade WordPress');
    292     $parent_file = 'tools.php';
    293307    require_once('admin-header.php');
    294308    core_upgrade_preamble();
    295     include('admin-footer.php');
    296309} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
    297310    check_admin_referer('upgrade-core');
    298     $title = __('Upgrade WordPress');
    299     $parent_file = 'tools.php';
    300311    // do the (un)dismiss actions before headers,
    301312    // so that they can redirect
     
    311322    if ( isset( $_POST['upgrade'] ) )
    312323        do_core_upgrade($reinstall);
    313     include('admin-footer.php');
    314 
    315 }?>
     324} elseif ( 'do-plugin-upgrade' == $action ) {
     325    check_admin_referer('upgrade-core');
     326    require_once('admin-header.php');
     327    do_plugin_upgrade();
     328}
     329
     330include('admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.