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

git-svn-id: https://develop.svn.wordpress.org/trunk@7433 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-20 23:43:54 +00:00
parent 385b02675c
commit 55d0af7437
1 changed files with 7 additions and 1 deletions

View File

@ -127,7 +127,13 @@ function wp_plugin_update_row( $file ) {
$r = $current->response[ $file ];
echo "<tr><td colspan='5' class='plugin-update'>";
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) );
if( current_user_can('edit_plugins') )
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);
else if( empty($r->package) )
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);
else
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) );
echo "</td></tr>";
}
add_action( 'after_plugin_row', 'wp_plugin_update_row' );