WordPress.org

Make WordPress Core

Ticket #18467: 18467.3.patch

File 18467.3.patch, 1.9 KB (added by ocean90, 2 years ago)
  • 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/** 
     
    531534 * 
    532535 */ 
    533536function _redirect_to_about_wordpress() { 
    534         // Only for WP version < 3.3.0 
     537        // Only for WP version < 3.3.0  
    535538        if ( version_compare( $GLOBALS['wp_version'], '3.3.0', '>' ) ) 
    536539                return; 
     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        // Print javascript data 
     552        add_action( 'admin_footer-update-core.php', '_print_js_redirect_to_about_wordpress' ); 
     553         
     554        // Include admin-footer.php and exit 
     555        include(ABSPATH . 'wp-admin/admin-footer.php'); 
     556        exit(); 
     557} 
     558add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' ); 
     559 
     560/** 
     561 * Print Javascript data for _redirect_to_about_wordpress(). 
     562 * 
     563 * This is a temporary function for the 3.3 upgrade only and will be removed in a later version. 
     564 *  
     565 * @since 3.3.0 
     566 * 
     567 */ 
     568function _print_js_redirect_to_about_wordpress() { 
    537569?> 
    538570<script type="text/javascript"> 
    539571window.location = '<?php echo admin_url( 'about.php?upgraded' ); ?>'; 
    540572</script> 
    541573<?php 
    542574} 
    543  
    544 add_action( 'admin_footer-update-core.php', '_redirect_to_about_wordpress' ); 
    545 ?>