From c9421f440114d1febc40d762b510c9ca1d5d9dc2 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Thu, 29 Jun 2023 07:21:22 +0000 Subject: [PATCH] Upgrade/Install: Only show errors if there is nothing to update. Previously, when the `do-plugin-upgrade` or `do-theme-upgrade` actions were accessed directly on `update-core.php`, an error message stating "Select one or more (plugins|themes) to update" would be shown even if there was nothing to update. This ensures that the error message only appears when there is something to update. Props Presskopp, sabernhardt, pbiron, afragen, zunaid321, shuvoaftab, ugyensupport, costdev. Fixes #57999. Built from https://develop.svn.wordpress.org/trunk@56107 git-svn-id: http://core.svn.wordpress.org/trunk@55619 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/update-core.php | 16 ++++++++++++---- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 7caa1063c1..3aefbb89ba 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -1037,13 +1037,21 @@ if ( 'upgrade-core' === $action ) {

'; if ( 'themes' === $upgrade_error ) { - _e( 'Please select one or more themes to update.' ); + $theme_updates = get_theme_updates(); + if ( ! empty( $theme_updates ) ) { + echo '

'; + _e( 'Please select one or more themes to update.' ); + echo '

'; + } } else { - _e( 'Please select one or more plugins to update.' ); + $plugin_updates = get_plugin_updates(); + if ( ! empty( $plugin_updates ) ) { + echo '

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

'; + } } - echo '

'; } $last_update_check = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index d845d0eea8..5b0fba8508 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-beta2-56106'; +$wp_version = '6.3-beta2-56107'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.