WordPress.org

Make WordPress Core

Ticket #18467: 18467.2.patch

File 18467.2.patch, 1.5 KB (added by ocean90, 7 years ago)
  • wp-admin/includes/update-core.php

     
    522522        return true;
    523523}
    524524
     525/**
     526 * Redirect to the About WordPress page after a successful upgrade.
     527 *
     528 * This is a temporary function for the 3.3 upgrade only and will be removed in a later version.
     529 *
     530 * @since 3.3.0
     531 *
     532 */
     533function _redirect_to_about_wordpress() {
     534        // Only for WP version < 3.3.0
     535        if ( version_compare( $GLOBALS['wp_version'], '3.3.0', '>' ) )
     536                return;
    525537?>
     538<script type="text/javascript">
     539// On success WordPress will display a link to dashboard
     540if ( jQuery( '.wrap > p > a' ).length )
     541        window.location = '<?php echo admin_url( 'about.php?afterupgrade=1' ); ?>';
     542</script>
     543<?php
     544}
     545
     546add_action( 'admin_footer-update-core.php', '_redirect_to_about_wordpress' );
     547?>
  • wp-admin/about.php

     
    161161</div>
    162162
    163163<div class="return-to-dashboard">
     164        <?php if( current_user_can( 'update_core' ) && isset( $_GET['afterupgrade'] ) ) : ?>
    164165        <a href="<?php echo admin_url( 'update-core.php' ); ?>"><?php _e( 'Return to Dashboard &rarr; Updates' ); ?></a> |
     166        <?php endif; ?>
    165167        <a href="<?php echo admin_url(); ?>"><?php _e( 'Go to Dashboard &rarr; Home' ); ?></a>
    166168</div>
    167169