WordPress.org

Make WordPress Core

Changeset 12436


Ignore:
Timestamp:
12/17/09 20:18:12 (4 years ago)
Author:
ryan
Message:

Give feedback when Upgrade Plugins is clicked but no plugins are selected. see #10973

File:
1 edited

Legend:

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

    r12413 r12436  
    9696 */ 
    9797function core_upgrade_preamble() { 
     98    global $upgrade_error; 
     99 
    98100    $updates = get_core_updates(); 
    99101?> 
     
    102104    <h2><?php _e('Upgrade WordPress'); ?></h2> 
    103105<?php 
     106    if ( $upgrade_error ) { 
     107        echo '<div class="error"><p>'; 
     108        _e('Please select one or more plugins to upgrade.'); 
     109        echo '</p></div>'; 
     110    } 
     111 
    104112    if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { 
    105113        echo '<h3>'; 
     
    332340    if ( isset($_GET['plugins']) ) { 
    333341        $plugins = explode(',', $_GET['plugins']); 
     342    } elseif ( isset($_POST['checked']) ) { 
     343        $plugins = (array) $_POST['checked']; 
    334344    } else { 
    335         $plugins = (array) $_POST['checked']; 
     345        // Nothing to do. 
     346        return; 
    336347    } 
    337348    $url = 'update-core.php?action=do-plugin-upgrade&amp;plugins=' . urlencode(join(',', $plugins)); 
     
    343354 
    344355$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core'; 
     356 
     357$upgrade_error = false; 
     358if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) { 
     359    $upgrade_error = true; 
     360    $action = 'upgrade-core'; 
     361} 
    345362 
    346363$title = __('Upgrade WordPress'); 
Note: See TracChangeset for help on using the changeset viewer.