WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/10/2020 06:06:46 AM (16 months ago)
Author:
whyisjake
Message:

Upgrade/Install: Ensure cleanup after canceled update.

Ensure that the uploaded zip is hidden from the media library, where a task will remove failed installs after two hours.

Fixes #50612.

Props psykro, desrosj, joyously, azaozz, noisysocks, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-theme-installer-skin.php

    r48390 r48417  
    322322
    323323            $install_actions['ovewrite_theme'] = sprintf(
    324                 '<a class="button button-primary" href="%s" target="_parent">%s</a>',
     324                '<a class="button button-primary update-from-upload-overwrite" href="%s" target="_parent">%s</a>',
    325325                wp_nonce_url( add_query_arg( 'overwrite', $overwrite, $this->url ), 'theme-upload' ),
    326                 esc_html( __( 'Replace current with uploaded' ) )
     326                __( 'Replace current with uploaded' )
    327327            );
    328328        } else {
     
    330330        }
    331331
     332        $cancel_url = add_query_arg( 'action', 'upload-theme-cancel-overwrite', $this->url );
     333
    332334        $install_actions['themes_page'] = sprintf(
    333335            '<a class="button" href="%s" target="_parent">%s</a>',
    334             self_admin_url( 'theme-install.php' ),
     336            wp_nonce_url( $cancel_url, 'theme-upload-cancel-overwrite' ),
    335337            __( 'Cancel and go back' )
    336338        );
     
    348350
    349351        if ( ! empty( $install_actions ) ) {
     352            printf(
     353                '<p class="update-from-upload-expired hidden">%s</p>',
     354                __( 'The uploaded file has expired. Please go back and upload it again.' )
     355            );
    350356            echo '<p class="update-from-upload-actions">' . implode( ' ', (array) $install_actions ) . '</p>';
    351357        }
Note: See TracChangeset for help on using the changeset viewer.