Plugins: Only show details link if user can install plugins.

fixes #17902.

Built from https://develop.svn.wordpress.org/trunk@29595


git-svn-id: http://core.svn.wordpress.org/trunk@29369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-08-25 15:28:17 +00:00
parent b06652da92
commit 4261ce75a6
1 changed files with 14 additions and 16 deletions

View File

@ -519,11 +519,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
$plugin_meta[] = sprintf( __( 'By %s' ), $author ); $plugin_meta[] = sprintf( __( 'By %s' ), $author );
} }
if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) ) {
// Details link using API info, if available // Details link using API info, if available
if ( isset( $plugin_data['slug'] ) ) { if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
$plugin_meta[] = sprintf( '<a href="%s" class="thickbox" aria-label="%s" data-title="%s">%s</a>', $plugin_meta[] = sprintf( '<a href="%s" class="thickbox" aria-label="%s" data-title="%s">%s</a>',
esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
'&TB_iframe=true&width=600&height=550' ) ), '&TB_iframe=true&width=600&height=550' ) ),
esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ), esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
esc_attr( $plugin_name ), esc_attr( $plugin_name ),
@ -535,7 +534,6 @@ class WP_Plugins_List_Table extends WP_List_Table {
__( 'Visit plugin site' ) __( 'Visit plugin site' )
); );
} }
}
/** /**
* Filter the array of row meta for each plugin in the Plugins list table. * Filter the array of row meta for each plugin in the Plugins list table.