_redirect_to_about_wordpress

Redirect to the About WordPress page after a successful upgrade.

Description

_redirect_to_about_wordpress( (string) $new_version ); 

This function is only needed when the existing install is older than 3.4.0.

Parameters (1)

0. $new_version (string)
The new version.

Usage

  1. if ( !function_exists( '_redirect_to_about_wordpress' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/update-core.php'; 
  3.  
  4. // The new version. 
  5. $new_version = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _redirect_to_about_wordpress($new_version); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/update-core.php  
  1. function _redirect_to_about_wordpress( $new_version ) { 
  2. global $wp_version, $pagenow, $action; 
  3.  
  4. if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) 
  5. return; 
  6.  
  7. // Ensure we only run this on the update-core.php page. The Core_Upgrader may be used in other contexts. 
  8. if ( 'update-core.php' != $pagenow ) 
  9. return; 
  10.  
  11. if ( 'do-core-upgrade' != $action && 'do-core-reinstall' != $action ) 
  12. return; 
  13.  
  14. // Load the updated default text localization domain for new strings. 
  15.  
  16. // See do_core_upgrade() 
  17. show_message( __('WordPress updated successfully') ); 
  18.  
  19. // self_admin_url() won't exist when upgrading from <= 3.0, so relative URLs are intentional. 
  20. 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="%2$s">here</a>.' ), $new_version, 'about.php?updated' ) . '</span>' ); 
  21. show_message( '<span class="hide-if-js">' . sprintf( __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $new_version, 'about.php?updated' ) . '</span>' ); 
  22. echo '</div>'; 
  23. ?> 
  24. <script type="text/javascript"> 
  25. window.location = 'about.php?updated'; 
  26. </script> 
  27. <?php 
  28.  
  29. // Include admin-footer.php and exit. 
  30. include(ABSPATH . 'wp-admin/admin-footer.php'); 
  31. exit();