Make WordPress Core

Ticket #25654: 25654.diff

File 25654.diff, 3.4 KB (added by dd32, 11 years ago)
  • src/wp-admin/includes/class-wp-upgrader.php

     
    20712071                        'timestamp' => time(),
    20722072                ) );
    20732073
     2074                $next_user_core_update = get_preferred_from_update_core();
     2075                // If the update transient is empty, use the update we just performed
     2076                if ( ! $next_user_core_update )
     2077                        $next_user_core_update = $core_update;
     2078                $newer_version_available = ( 'update' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update, '>' ) );
     2079
    20742080                /**
    20752081                 * Filter whether to send an email following an automatic background core update.
    20762082                 *
     
    21052111                                return;
    21062112                }
    21072113
    2108                 $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $core_update->current );
     2114                if ( 'success' == $type )
     2115                        $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $core_update->current );
     2116                else
     2117                        $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $next_user_core_update->current );
    21092118
    21102119                $body = '';
    21112120
    21122121                switch ( $type ) {
    21132122                        case 'success' :
    21142123                                $body .= sprintf( __( 'Howdy! Your site at %1$s has been updated automatically to WordPress %2$s.' ), home_url(), $core_update->current );
    2115                                 $body .= "\n\n" . __( 'No further action is needed on your part.' );
     2124                                if ( ! $newer_version_available ) {
     2125                                        $body .= "\n\n" . __( 'No further action is needed on your part.' );
     2126                                } else {
     2127                                        $body .= "\n\n" . __( 'WordPress %s is also now available.' ) . ' ';
     2128                                        $body .= __( 'Updating is easy and only takes a few moments:' );
     2129                                        $body .= "\n" . network_admin_url( 'update-core.php' );
     2130                                }
    21162131
    21172132                                // Can only reference the About screen if their update was successful.
    21182133                                list( $about_version ) = explode( '-', $core_update->current, 2 );
     
    21222137
    21232138                        case 'fail' :
    21242139                        case 'manual' :
    2125                                 $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $core_update->current );
     2140                                $body .= sprintf( __( 'Please update your site at %1$s to WordPress %2$s.' ), home_url(), $next_user_core_update->current );
    21262141
    21272142                                $body .= "\n\n";
    2128                                 if ( 'fail' == $type )
    2129                                         $body .= __( 'We tried but were unable to update your site automatically.' ) . ' ';
     2143                                if ( 'fail' == $type ) {
     2144                                        if ( $newer_version_available ) {
     2145                                                $body .= sprintf( __( 'We tried but were unable to update your site automatically to WordPress %s.' ), $core_update->current );
     2146                                        } else {
     2147                                                $body .= __( 'We tried but were unable to update your site automatically.' );
     2148                                        }
     2149                                        $body .= ' ';
     2150                                }
     2151
    21302152                                $body .= __( 'Updating is easy and only takes a few moments:' );
    21312153                                $body .= "\n" . network_admin_url( 'update-core.php' );
    21322154                                break;
    21332155
    21342156                        case 'critical' :
    2135                                 $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version of WordPress, %2$s.' ), home_url(), $core_update->current );
     2157                                $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to WordPress, %2$s.' ), home_url(), $core_update->current );
    21362158
    21372159                                $body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." );
    21382160