Make WordPress Core

Ticket #4869: 4869.2.diff

File 4869.2.diff, 1.4 KB (added by johnbillion, 17 years ago)

Replaces 2 previous patches, Check for manage_options capability, advise unpriv'd users to notify site admin, fix indentation

  • wp-admin/includes/update.php

     
    33// The admin side of our 1.0 update system
    44
    55function core_update_footer( $msg ) {
     6        if ( !current_user_can('manage_options') )
     7                return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
     8
    69        $cur = get_option( 'update_core' );
    710
    811        switch ( $cur->response ) {
     
    2326add_filter( 'update_footer', 'core_update_footer' );
    2427
    2528function update_nag() {
    26 $cur = get_option( 'update_core' );
     29        $cur = get_option( 'update_core' );
    2730
    28 if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
    29         return false;
     31        if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
     32                return false;
    3033
    31 ?>
    32 <div id="update-nag"><?php printf( __('A new version of WordPress is available! <a href="%s">Please update now</a>.'), $cur->url ); ?></div>
    33 <?php
     34        if ( current_user_can('manage_options') )
     35                $msg = sprintf( __('A new version of WordPress is available! <a href="%s">Please update now</a>.'), $cur->url );
     36        else
     37                $msg = __('A new version of WordPress is available! Please notify the site administrator.');
     38
     39        echo "<div id='update-nag'>$msg</div>";
    3440}
    3541add_action( 'admin_notices', 'update_nag', 3 );
    3642
     
    109115}
    110116add_action( 'after_plugin_row', 'wp_plugin_update_row' );
    111117
    112 ?>
     118?>
     119 No newline at end of file