From 55d0af743789f3eeb79e7130ae9a34967397c4b5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 20 Mar 2008 23:43:54 +0000 Subject: [PATCH] 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 --- wp-admin/includes/update.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 461c93457f..4fa8fef708 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -127,7 +127,13 @@ function wp_plugin_update_row( $file ) { $r = $current->response[ $file ]; echo ""; - printf( __('There is a new version of %1$s available. Download version %3$s here or upgrade automatically.'), $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. Download version %3$s here.'), $plugin_data['Name'], $r->url, $r->new_version); + else if( empty($r->package) ) + printf( __('There is a new version of %1$s available. Download version %3$s here automatic upgrade unavailable for this plugin.'), $plugin_data['Name'], $r->url, $r->new_version); + else + printf( __('There is a new version of %1$s available. Download version %3$s here or upgrade automatically.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&plugin=$file", 'upgrade-plugin_' . $file) ); + echo ""; } add_action( 'after_plugin_row', 'wp_plugin_update_row' );