diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 3edfa702b8..0b080d961e 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -15,7 +15,7 @@ function core_update_footer( $msg = '' ) { switch ( $cur->response ) { case 'development' : - return sprintf( '| '.__( 'You are using a development version (%1$s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], wp_nonce_url('update.php?action=upgrade-core', 'upgrade-core')); + return sprintf( '| '.__( 'You are using a development version (%1$s). Cool! Please stay updated.' ), $GLOBALS['wp_version'], 'update.php?action=upgrade-core'); break; case 'upgrade' : @@ -39,7 +39,7 @@ function update_nag() { return false; if ( current_user_can('manage_options') ) - $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, wp_nonce_url('update.php?action=upgrade-core', 'upgrade-core') ); + $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, 'update.php?action=upgrade-core' ); else $msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur->current ); @@ -53,7 +53,7 @@ function update_right_now_message() { $msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] ); if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') ) - $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; + $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; echo "$msg"; } diff --git a/wp-admin/update.php b/wp-admin/update.php index d25b4c5392..5e284cf7bc 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -44,6 +44,40 @@ function do_plugin_upgrade($plugin) { echo ''; } +function core_upgrade_preamble() { + $update = get_option('update_core'); + + echo '
'; + echo '

' . __('Upgrade WordPress') . '

'; + + if ( !isset($update->response) || 'latest' == $update->response ) { + _e('You have the latest version of WordPress. You do not need to upgrade.'); + echo '
'; + return; + } + + if ( 'development' == $update->response ) { + $message = __('You are using a developmemt version of WordPress. You can upgrade to the latest nightly build automatically or download the nightly build and install it manually. Which would you like to do?'); + $submit = __('Download nightly build'); + } else { + $message = sprintf(__('You can upgrade to version %s automatically or download the nightly build and install it manually. Which would you like to do?'), $update->current); + $submit = sprintf(__('Download %s'), $update->current); + } + + echo '

'; + echo $message; + echo '

'; + echo '
'; + wp_nonce_field('upgrade-core'); + echo '

'; + echo ''; + echo '' . $submit . ''; + echo '

'; + echo '
'; + + echo ''; +} + function do_core_upgrade() { global $wp_filesystem; @@ -118,7 +152,13 @@ wp_admin_css( 'colors', true ); } echo ""; } elseif ( 'upgrade-core' == $_GET['action'] ) { - //check_admin_referer('upgrade-core'); + $title = __('Upgrade WordPress'); + $parent_file = 'index.php'; + require_once('admin-header.php'); + core_upgrade_preamble(); + include('admin-footer.php'); + } elseif ( 'do-core-upgrade' ) { + check_admin_referer('upgrade-core'); $title = __('Upgrade WordPress'); $parent_file = 'index.php'; require_once('admin-header.php');