From d73b6930ea25aeeb75a80b110bd5e5c0df2ec8ce Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@12436 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 d63626917..66846d2d5 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';