Plugins: Only show details link if user can install plugins.
fixes #17902. git-svn-id: https://develop.svn.wordpress.org/trunk@29595 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fae5c2de6f
commit
e8d8b21cec
|
@ -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' )
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue