mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
Don't show plugin upgrade notice if user cannot edit_plugins. Props DD32. fixes #6248
git-svn-id: http://svn.automattic.com/wordpress/trunk@7433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
609f04c4b9
commit
bf281b5a7b
@ -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&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&plugin=$file", 'upgrade-plugin_' . $file) );
|
||||
|
||||
echo "</td></tr>";
|
||||
}
|
||||
add_action( 'after_plugin_row', 'wp_plugin_update_row' );
|
||||
|
Loading…
Reference in New Issue
Block a user