- $actions = array();
- $is_active = is_plugin_active($plugin_file);
-
- if ( $is_active )
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
- else
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
-
- if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
- $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
-
- if ( ! $is_active && current_user_can('delete_plugins') )
- $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
-
- $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+ // preorder
+ $actions = array(
+ 'network_deactivate' => '', 'deactivate' => '',
+ 'network_only' => '', 'activate' => '',
+ 'network_activate' => '',
+ 'edit' => '',
+ 'delete' => '',
+ );
+
+ if ( 'mustuse' == $context ) {
+ $is_active = true;
+ } elseif ( 'dropins' == $context ) {
+ $dropins = _get_dropins();
+ $plugin_name = $plugin_file;
+ if ( $plugin_file != $plugin_data['Name'] )
+ $plugin_name .= '<br/>' . $plugin_data['Name'];
+ if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } else {
+ $is_active = false;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
+ }
+ if ( $plugin_data['Description'] )
+ $description .= '<p>' . $plugin_data['Description'] . '</p>';
+ } else {
+ $is_active_for_network = is_plugin_active_for_network($plugin_file);
+ $is_active = $is_active_for_network || is_plugin_active( $plugin_file );
+ if ( $is_active_for_network && !is_super_admin() )
+ continue;
+
+ if ( $is_active ) {
+ if ( $is_active_for_network ) {
+ if ( is_super_admin() )
+ $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
+ } else {
+ $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
+ }
+ } else {
+ if ( is_multisite() && is_network_only_plugin( $plugin_file ) )
+ $actions['network_only'] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>';
+ else
+ $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
+
+ if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
+ $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
+
+ if ( current_user_can('delete_plugins') )
+ $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
+ } // end if $is_active
+
+ if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
+ $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
+ } // end if $context
+
+ $actions = apply_filters( 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );