Ticket #25654: 25654.diff
File 25654.diff, 3.4 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/class-wp-upgrader.php
2071 2071 'timestamp' => time(), 2072 2072 ) ); 2073 2073 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 2074 2080 /** 2075 2081 * Filter whether to send an email following an automatic background core update. 2076 2082 * … … 2105 2111 return; 2106 2112 } 2107 2113 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 ); 2109 2118 2110 2119 $body = ''; 2111 2120 2112 2121 switch ( $type ) { 2113 2122 case 'success' : 2114 2123 $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 } 2116 2131 2117 2132 // Can only reference the About screen if their update was successful. 2118 2133 list( $about_version ) = explode( '-', $core_update->current, 2 ); … … 2122 2137 2123 2138 case 'fail' : 2124 2139 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 ); 2126 2141 2127 2142 $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 2130 2152 $body .= __( 'Updating is easy and only takes a few moments:' ); 2131 2153 $body .= "\n" . network_admin_url( 'update-core.php' ); 2132 2154 break; 2133 2155 2134 2156 case 'critical' : 2135 $body .= sprintf( __( 'Your site at %1$s experienced a critical failure while trying to update to the latest version ofWordPress, %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 ); 2136 2158 2137 2159 $body .= "\n\n" . __( "This means your site may be offline or broken. Don't panic; this can be fixed." ); 2138 2160