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,22 +519,20 @@ 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'] ) && current_user_can( 'install_plugins' ) ) {
if ( isset( $plugin_data['slug'] ) ) { $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( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
esc_url( self_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 ), __( 'View details' )
__( 'View details' ) );
); } elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
} elseif ( ! empty( $plugin_data['PluginURI'] ) ) { $plugin_meta[] = sprintf( '<a href="%s">%s</a>',
$plugin_meta[] = sprintf( '<a href="%s">%s</a>', esc_url( $plugin_data['PluginURI'] ),
esc_url( $plugin_data['PluginURI'] ), __( 'Visit plugin site' )
__( 'Visit plugin site' ) );
);
}
} }
/** /**