Make WordPress Core

Ticket #35554: remove-all-version-mentions.diff

File remove-all-version-mentions.diff, 4.0 KB (added by dd32, 9 years ago)
  • src/wp-admin/includes/update.php

    function find_core_update( $version, $lo 
    171171        $updates = $from_api->updates;
    172172        foreach ( $updates as $update ) {
    173173                if ( $update->current == $version && $update->locale == $locale )
    174174                        return $update;
    175175        }
    176176        return false;
    177177}
    178178
    179179/**
    180180 *
    181181 * @param string $msg
    182182 * @return string
    183183 */
    184184function core_update_footer( $msg = '' ) {
    185185        if ( !current_user_can('update_core') )
    186                 return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
     186                return '';
    187187
    188188        $cur = get_preferred_from_update_core();
    189189        if ( ! is_object( $cur ) )
    190190                $cur = new stdClass;
    191191
    192192        if ( ! isset( $cur->current ) )
    193193                $cur->current = '';
    194194
    195195        if ( ! isset( $cur->url ) )
    196196                $cur->url = '';
    197197
    198198        if ( ! isset( $cur->response ) )
    199199                $cur->response = '';
    200200
    201201        switch ( $cur->response ) {
    202202        case 'development' :
    203203                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' ) );
    204204
    205205        case 'upgrade' :
    206206                return '<strong><a href="' . network_admin_url( 'update-core.php' ) . '">' . sprintf( __( 'Get Version %s' ), $cur->current ) . '</a></strong>';
    207207
    208208        case 'latest' :
    209209        default :
    210                 return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
     210                return '';
    211211        }
    212212}
    213213
    214214/**
    215215 *
    216216 * @global string $pagenow
    217217 * @return false|void
    218218 */
    219219function update_nag() {
    220220        if ( is_multisite() && !current_user_can('update_core') )
    221221                return false;
    222222
    223223        global $pagenow;
    224224
    225225        if ( 'update-core.php' == $pagenow )
    function update_nag() { 
    228228        $cur = get_preferred_from_update_core();
    229229
    230230        if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
    231231                return false;
    232232
    233233        if ( current_user_can('update_core') ) {
    234234                $msg = sprintf( __('<a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
    235235        } else {
    236236                $msg = sprintf( __('<a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
    237237        }
    238238        echo "<div class='update-nag'>$msg</div>";
    239239}
    240240
    241241// Called directly from dashboard
    242242function update_right_now_message() {
    243         $theme_name = wp_get_theme();
    244         if ( current_user_can( 'switch_themes' ) ) {
    245                 $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme_name );
    246         }
    247 
    248         $msg = '';
    249 
    250         if ( current_user_can('update_core') ) {
    251                 $cur = get_preferred_from_update_core();
    252 
    253                 if ( isset( $cur->response ) && $cur->response == 'upgrade' )
    254                         $msg .= '<a href="' . network_admin_url( 'update-core.php' ) . '" class="button" aria-describedby="wp-version">' . sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a> ';
    255         }
    256 
    257         /* translators: 1: version number, 2: theme name */
    258         $content = __( 'WordPress %1$s running %2$s theme.' );
    259 
    260         /**
    261          * Filter the text displayed in the 'At a Glance' dashboard widget.
    262          *
    263          * Prior to 3.8.0, the widget was named 'Right Now'.
    264          *
    265          * @since 4.4.0
    266          *
    267          * @param string $content Default text.
    268          */
    269         $content = apply_filters( 'update_right_now_text', $content );
    270 
    271         $msg .= sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );
    272 
    273         echo "<p id='wp-version-message'>$msg</p>";
    274243}
    275244
    276245/**
    277246 * @since 2.9.0
    278247 *
    279248 * @return array
    280249 */
    281250function get_plugin_updates() {
    282251        $all_plugins = get_plugins();
    283252        $upgrade_plugins = array();
    284253        $current = get_site_transient( 'update_plugins' );
    285254        foreach ( (array)$all_plugins as $plugin_file => $plugin_data) {
    286255                if ( isset( $current->response[ $plugin_file ] ) ) {
    287256                        $upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
    288257                        $upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];