WordPress.org

Make WordPress Core

Ticket #15525: 15525.patch

File 15525.patch, 3.4 KB (added by ocean90, 3 years ago)

Refreshed, only /network/update-core.php fix

  • wp-includes/admin-bar.php

     
    275275 
    276276        $update_title = sprintf( __('Updates %s'), "<span id='ab-updates' class='count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ); 
    277277 
    278         $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => admin_url('update-core.php') ) ); 
     278        $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); 
     279 
     280        $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => $href ) ); 
    279281} 
    280282 
    281283/** 
  • wp-admin/includes/update.php

     
    9898        if ( ! isset( $cur->response ) ) 
    9999                $cur->response = ''; 
    100100 
     101        $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); 
     102         
    101103        switch ( $cur->response ) { 
    102104        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'], 'update-core.php'); 
     105                return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], $href ); 
    104106        break; 
    105107 
    106108        case 'upgrade' : 
    107                 return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', 'update-core.php', $cur->current); 
     109                return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', $href, $cur->current); 
    108110        break; 
    109111 
    110112        case 'latest' : 
     
    129131        if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) 
    130132                return false; 
    131133 
    132         if ( current_user_can('update_core') ) 
    133                 $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, 'update-core.php' ); 
    134         else 
     134        if ( current_user_can('update_core') ) { 
     135                $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); 
     136 
     137                $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, $href ); 
     138        } else 
    135139                $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current ); 
    136140 
    137141        echo "<div class='update-nag'>$msg</div>"; 
     
    146150        $cur = get_preferred_from_update_core(); 
    147151 
    148152        $msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] ); 
    149         if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) 
    150                 $msg .= " <a href='update-core.php' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>'; 
    151153 
     154        if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) { 
     155                $href = is_multisite() ? network_admin_url( 'update-core.php' ) : admin_url( 'update-core.php' ); 
     156                $msg .= " <a href='" . $href . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>'; 
     157        } 
     158 
    152159        echo "<span id='wp-version-message'>$msg</span>"; 
    153160} 
    154161