From e209ce594847da2b7b04bc513c1c96bee4db8c4a Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 1 Dec 2011 04:38:51 +0000 Subject: [PATCH] Finalize the code which redirects to about.php after a core update. Only triggers on update-core.php in case wp_update_core() is called in a different context. props ocean90 for initial patch. fixes #18467. git-svn-id: http://svn.automattic.com/wordpress/trunk@19524 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/about.php | 6 +++-- wp-admin/includes/update-core.php | 41 ++++++++++++++++++++----------- wp-admin/update-core.php | 17 ++++++++++--- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/wp-admin/about.php b/wp-admin/about.php index 8b18f0e42..be070b84a 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -160,8 +160,10 @@ include( './admin-header.php' );
- - | + + |
diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 617200aea..b720e1d4f 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -465,6 +465,11 @@ function update_core($from, $to) { // Remove maintenance file, we're done. $wp_filesystem->delete($maintenance_file); + + // If we made it this far: + do_action( '_core_updated_successfully', $wp_version ); + + return $wp_version; } /** @@ -525,21 +530,29 @@ function _copy_dir($from, $to, $skip_list = array() ) { /** * Redirect to the About WordPress page after a successful upgrade. * - * This is a temporary function for the 3.3 upgrade only and will be removed in a later version. - * + * This function is only needed when the existing install is older than 3.3.0. + * * @since 3.3.0 * */ -function _redirect_to_about_wordpress() { - // Only for WP version < 3.3.0 - if ( version_compare( $GLOBALS['wp_version'], '3.3.0', '>' ) ) - return; -?> - - + // See do_core_upgrade() + show_message( __('WordPress updated successfully') ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $wp_version, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $wp_version, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + echo ''; + ?> + + get_error_code() ) show_message( __('Installation Failed') ); - } else { - show_message( __('WordPress updated successfully') ); - show_message( '' . __('Go to Dashboard') . '' ); + echo ''; + return; } - echo ''; + + show_message( __('WordPress updated successfully') ); + show_message( __('WordPress updated successfully') ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click here.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + show_message( '' . sprintf( __( 'Welcome to WordPress %1$s. Learn more.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '' ); + ?> + + +