WordPress.org

Make WordPress Core

Ticket #18467: 18467.4.patch

File 18467.4.patch, 1.6 KB (added by ocean90, 4 years ago)

Don't wait until page is rendered complete, redirect as fast as we can.

  • wp-admin/includes/update-core.php

     
    465465 
    466466        // Remove maintenance file, we're done. 
    467467        $wp_filesystem->delete($maintenance_file); 
     468 
     469        // No return yet => succesfull 
     470        do_action( '_core_updated_successfully' ); 
    468471} 
    469472 
    470473/** 
     
    526529 * Redirect to the About WordPress page after a successful upgrade. 
    527530 * 
    528531 * This is a temporary function for the 3.3 upgrade only and will be removed in a later version. 
    529  *  
     532 * 
    530533 * @since 3.3.0 
    531534 * 
    532535 */ 
     
    534537        // Only for WP version < 3.3.0 
    535538        if ( version_compare( $GLOBALS['wp_version'], '3.3.0', '>' ) ) 
    536539                return; 
    537 ?> 
     540 
     541        // Load the updated default text localization domain for new strings 
     542        unload_textdomain( 'default' ); // Needed? 
     543        $locale = get_locale(); 
     544        load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" ); 
     545 
     546        // Show info messages, see do_core_upgrade() 
     547        show_message( __('WordPress updated successfully') ); 
     548        show_message( sprintf( __('You will be redirected to the About WordPress Page, if not click <a href="%s">here</a>'), esc_url( admin_url( 'about.php?upgraded' ) ) ) ); 
     549        echo '</div>'; 
     550 
     551        ?> 
    538552<script type="text/javascript"> 
    539553window.location = '<?php echo admin_url( 'about.php?upgraded' ); ?>'; 
    540554</script> 
    541 <?php 
     555        <?php 
     556 
     557        // Include admin-footer.php and exit 
     558        include(ABSPATH . 'wp-admin/admin-footer.php'); 
     559        exit(); 
    542560} 
    543  
    544 add_action( 'admin_footer-update-core.php', '_redirect_to_about_wordpress' ); 
    545 ?> 
     561add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );