Make WordPress Core


Ignore:
Timestamp:
12/10/2008 07:59:05 AM (15 years ago)
Author:
ryan
Message:

Fix reinstall

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/update-core.php

    r10150 r10166  
    2020        $current = true;
    2121    $submit = __('Upgrade Automatically');
     22    $form_action = 'update-core.php?action=do-core-upgrade';
    2223    if ( 'development' == $update->response ) {
    2324        $message = __('You are using a development version of WordPress.  You can upgrade to the latest nightly build automatically or download the nightly build and install it manually:');
     
    2728            $message = sprintf(__('You have the latest version of WordPress. You do not need to upgrade. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string);
    2829            $submit = __('Re-install Automatically');
     30            $form_action = 'update-core.php?action=do-core-reinstall';
    2931        } else {
    3032            $message =  sprintf(__('You can upgrade to version %s automatically or download the package and install it manually:'), $version_string);
     
    3638    echo $message;
    3739    echo '</p>';
    38     echo '<form method="post" action="update-core.php?action=do-core-upgrade" name="upgrade" class="upgrade">';
     40    echo '<form method="post" action="' . $form_action . '" name="upgrade" class="upgrade">';
    3941    wp_nonce_field('upgrade-core');
    4042    echo '<p>';
     
    130132 * @return null
    131133 */
    132 function do_core_upgrade() {
     134function do_core_upgrade( $reinstall = false ) {
    133135    global $wp_filesystem;
    134136
     
    160162    }
    161163
     164    if ( $reinstall )
     165        $update->response = 'reinstall';
     166
    162167    $result = wp_update_core($update, 'show_message');
    163168
     
    200205    core_upgrade_preamble();
    201206    include('admin-footer.php');
    202 } elseif ( 'do-core-upgrade' == $action ) {
     207} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
    203208    check_admin_referer('upgrade-core');
    204209    $title = __('Upgrade WordPress');
     
    211216    do_undismiss_core_update();
    212217    require_once('admin-header.php');
     218    if ( 'do-core-reinstall' == $action )
     219        $reinstall = true;
     220    else
     221        $reinstall = false;
    213222    if ( isset( $_POST['upgrade'] ) )
    214         do_core_upgrade();
     223        do_core_upgrade($reinstall);
    215224    include('admin-footer.php');
     225
    216226}?>
Note: See TracChangeset for help on using the changeset viewer.