WordPress.org

Make WordPress Core

Changeset 7433


Ignore:
Timestamp:
03/20/08 23:43:54 (6 years ago)
Author:
ryan
Message:

Don't show plugin upgrade notice if user cannot edit_plugins. Props DD32. fixes #6248

File:
1 edited

Legend:

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

    r7238 r7433  
    128128 
    129129    echo "<tr><td colspan='5' class='plugin-update'>"; 
    130     printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file", 'upgrade-plugin_' . $file) ); 
     130    if( current_user_can('edit_plugins') ) 
     131        printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version); 
     132    else if( empty($r->package) ) 
     133        printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_data['Name'], $r->url, $r->new_version); 
     134    else 
     135        printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file", 'upgrade-plugin_' . $file) ); 
     136     
    131137    echo "</td></tr>"; 
    132138} 
Note: See TracChangeset for help on using the changeset viewer.