Make WordPress Core

Changeset 5994


Ignore:
Timestamp:
08/30/2007 06:21:03 PM (17 years ago)
Author:
markjaquith
Message:

Check manage_options for upgrade notification. Tailor message accordingly. Props johnbillion. fixes #4869

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/update.php

    r5987 r5994  
    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
     
    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 );
Note: See TracChangeset for help on using the changeset viewer.