Ticket #18467: 18467.2.diff
| File 18467.2.diff, 5.6 KB (added by , 14 years ago) |
|---|
-
wp-admin/includes/class-wp-upgrader.php
975 975 $working_dir = $this->unpack_package( $download ); 976 976 if ( is_wp_error($working_dir) ) 977 977 return $working_dir; 978 978 /* 979 979 // Copy update-core.php from the new version into place. 980 980 if ( !$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) { 981 981 $wp_filesystem->delete($working_dir, true); 982 982 return new WP_Error('copy_failed', $this->strings['copy_failed']); 983 983 } 984 984 $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); 985 985 */ 986 986 require(ABSPATH . 'wp-admin/includes/update-core.php'); 987 987 988 988 return update_core($working_dir, $wp_dir); -
wp-admin/includes/update-core.php
374 374 $maintenance_file = $to . '.maintenance'; 375 375 $wp_filesystem->delete($maintenance_file); 376 376 $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE); 377 377 $result = true; 378 /* 378 379 // Copy new versions of WP files into place. 379 380 $result = _copy_dir($from . $distro, $to, array('wp-content') ); 380 381 */ 381 382 // Custom Content Directory needs updating now. 382 383 // Copy Languages 383 384 if ( !is_wp_error($result) && $wp_filesystem->is_dir($from . $distro . 'wp-content/languages') ) { … … 465 466 466 467 // Remove maintenance file, we're done. 467 468 $wp_filesystem->delete($maintenance_file); 469 470 // If we made it this far: 471 do_action( '_core_updated_successfully', $wp_version ); 472 473 return $wp_version; 468 474 } 469 475 470 476 /** … … 525 531 /** 526 532 * Redirect to the About WordPress page after a successful upgrade. 527 533 * 528 * This is a temporary function for the 3.3 upgrade only and will be removed in a later version.529 * 534 * This function is only needed when the existing install is older than 3.3.0. 535 * 530 536 * @since 3.3.0 531 537 * 532 538 */ 533 function _redirect_to_about_wordpress() { 534 // Only for WP version < 3.3.0 535 if ( version_compare( $GLOBALS['wp_version'], '3.3.0', '>' ) ) 536 return; 537 ?> 539 function _redirect_to_about_wordpress( $wp_version ) { 540 // Load the updated default text localization domain for new strings 541 load_default_textdomain(); 542 543 // See do_core_upgrade() 544 show_message( __('WordPress updated successfully') ); 545 show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%s">here</a>.' ), $wp_version, esc_url( admin_url( 'about.php?updated' ) ) ) . '</span>' ); 546 show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $wp_version, esc_url( admin_url( 'about.php?updated' ) ) ) . '</span>' ); 547 echo '</div>'; 548 ?> 538 549 <script type="text/javascript"> 539 window.location = '<?php echo admin_url( 'about.php?upgraded' ); ?>';550 //window.location = '<?php echo admin_url( 'about.php?updated' ); ?>'; 540 551 </script> 541 <?php 552 <?php 553 554 // Include admin-footer.php and exit 555 include(ABSPATH . 'wp-admin/admin-footer.php'); 556 exit(); 542 557 } 543 544 add_action( 'admin_footer-update-core.php', '_redirect_to_about_wordpress' ); 545 ?> 558 if ( version_compare( $GLOBALS['wp_version'], '3.3', '<' ) ) 559 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' ); -
wp-admin/update-core.php
378 378 show_message($result); 379 379 if ('up_to_date' != $result->get_error_code() ) 380 380 show_message( __('Installation Failed') ); 381 } else { 382 show_message( __('WordPress updated successfully') ); 383 show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' ); 381 echo '</div>'; 382 return; 384 383 } 385 echo '</div>'; 384 385 show_message( __('WordPress updated successfully') ); 386 $message = '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '</span>'; 387 $message .= '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a> to learn more.' ), $result, esc_url( admin_url( 'about.php?updated' ) ) ) . '</span>'; 388 show_message( $message ); 389 ?> 390 </div> 391 <script type="text/javascript"> 392 //window.location = '<?php echo admin_url( 'about.php?upgraded' ); ?>'; 393 </script> 394 <?php 386 395 } 387 396 388 397 function do_dismiss_core_update() { -
wp-admin/about.php
160 160 </div> 161 161 162 162 <div class="return-to-dashboard"> 163 <?php if ( current_user_can( 'update_core' ) && isset( $_GET['upgraded'] ) ) : ?> 163 <?php 164 if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : 165 if ( is_multisite() ) : ?> 166 <a href="<?php echo esc_url( network_admin_url( 'update-core.php' ) ); ?>"><?php _e( 'Return to Updates' ); ?></a> | 167 <?php else : ?> 164 168 <a href="<?php echo esc_url( admin_url( 'update-core.php' ) ); ?>"><?php _e( 'Return to Dashboard → Updates' ); ?></a> | 165 <?php endif; ?> 169 <?php 170 endif; 171 endif; 172 ?> 166 173 <a href="<?php echo esc_url( admin_url() ); ?>"><?php _e( 'Go to Dashboard → Home' ); ?></a> 167 174 </div> 168 175