From f8bad23493c5d0d3ec6905beceea0b04775fa936 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 25 Oct 2008 22:22:29 +0000 Subject: [PATCH] Warn if the core updater failed to complete. See #7819. git-svn-id: https://develop.svn.wordpress.org/trunk@9348 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 8b7d712d66..1429d8126b 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -395,4 +395,18 @@ function wp_update_core($feedback = '') { return update_core($working_dir, $wp_dir); } +function maintenance_nag() { + global $upgrading; + if ( ! isset( $upgrading ) ) + return false; + + if ( current_user_can('manage_options') ) + $msg = sprintf( __('An automated WordPress update has failed to complete - please attempt the update again now.'), 'update.php?action=upgrade-core' ); + else + $msg = __('An automated WordPress update has failed to complete! Please notify the site administrator.'); + + echo "
$msg
"; +} +add_action( 'admin_notices', 'maintenance_nag' ); + ?>