From c3e7918ed8ee16e0218893dd6f58ba07a5bce344 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 17 Dec 2009 20:18:12 +0000 Subject: [PATCH] Give feedback when Upgrade Plugins is clicked but no plugins are selected. see #10973 git-svn-id: https://develop.svn.wordpress.org/trunk@12436 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/update-core.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index d636269171..66846d2d56 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -95,12 +95,20 @@ function dismissed_updates() { * @return null */ function core_upgrade_preamble() { + global $upgrade_error; + $updates = get_core_updates(); ?>

'; + _e('Please select one or more plugins to upgrade.'); + echo '

'; + } + if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { echo '

'; _e('You have the latest version of WordPress. You do not need to upgrade'); @@ -331,8 +339,11 @@ function do_plugin_upgrade() { if ( isset($_GET['plugins']) ) { $plugins = explode(',', $_GET['plugins']); - } else { + } elseif ( isset($_POST['checked']) ) { $plugins = (array) $_POST['checked']; + } else { + // Nothing to do. + return; } $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins)); $title = __('Upgrade Plugins'); @@ -343,6 +354,12 @@ function do_plugin_upgrade() { $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core'; +$upgrade_error = false; +if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) { + $upgrade_error = true; + $action = 'upgrade-core'; +} + $title = __('Upgrade WordPress'); $parent_file = 'tools.php';