WordPress.org

Make WordPress Core

Ticket #18629: 18629.2.patch

File 18629.2.patch, 2.3 KB (added by SergeyBiryukov, 7 years ago)
  • wp-admin/includes/update.php

     
    8686                return false;
    8787
    8888        if ( !current_user_can('update_core') )
    89                 return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
     89                return sprintf( __( 'Version %s' ), get_bloginfo('version', 'display') );
    9090
    9191        $cur = get_preferred_from_update_core();
    9292        if ( ! isset( $cur->current ) )
     
    100100
    101101        switch ( $cur->response ) {
    102102        case 'development' :
    103                 return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], network_admin_url( 'update-core.php' ) );
     103                return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), get_bloginfo('version', 'display'), network_admin_url( 'update-core.php' ) );
    104104        break;
    105105
    106106        case 'upgrade' :
     
    109109
    110110        case 'latest' :
    111111        default :
    112                 return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
     112                return sprintf( __( 'Version %s' ), get_bloginfo('version', 'display') );
    113113        break;
    114114        }
    115115}
     
    145145
    146146        $cur = get_preferred_from_update_core();
    147147
    148         $msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] );
     148        $msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), get_bloginfo('version', 'display') );
    149149
    150150        if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) {
    151151                $msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
     
    154154        echo "<span id='wp-version-message'>$msg</span>";
    155155}
    156156
     157/**
     158 * Adds SVN revision to WordPress version, if appropriate
     159 */
     160function get_svn_revision( $output, $show ) {
     161        if ( 'version' == $show && is_super_admin() && file_exists( ABSPATH . '.svn/entries' ) && $svn = file( ABSPATH . '.svn/entries' ) )
     162                $output .= '-r' . trim( $svn[3] );
     163
     164        return $output;
     165}
     166add_filter( 'bloginfo', 'get_svn_revision', 10, 2 );
     167
    157168function get_plugin_updates() {
    158169        $all_plugins = get_plugins();
    159170        $upgrade_plugins = array();