diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 7dfb8c0d76..ae2342bcc2 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -523,7 +523,15 @@ function print_plugins_table($plugins, $context = '') {
';
}
foreach ( (array)$plugins as $plugin_file => $plugin_data) {
- $actions = array();
+ // preorder
+ $actions = array(
+ 'network_deactivate' => '', 'deactivate' => '',
+ 'network_only' => '', 'activate' => '',
+ 'network_activate' => '',
+ 'edit' => '',
+ 'plugin_delete' => '',
+ );
+
if ( 'mustuse' == $context ) {
$is_active = true;
} elseif ( 'dropins' == $context ) {
@@ -551,28 +559,28 @@ function print_plugins_table($plugins, $context = '') {
if ( $is_active ) {
if ( $is_active_for_network ) {
if ( is_super_admin() )
- $actions[] = '' . __('Network Deactivate') . '';
+ $actions['network_deactivate'] = '' . __('Network Deactivate') . '';
} else {
- $actions[] = '' . __('Deactivate') . '';
+ $actions['deactivate'] = '' . __('Deactivate') . '';
}
} else {
if ( is_multisite() && is_network_only_plugin( $plugin_file ) )
- $actions[] = '' . __('Network Only') . '';
+ $actions['network_only'] = '' . __('Network Only') . '';
else
- $actions[] = '' . __('Activate') . '';
+ $actions['activate'] = '' . __('Activate') . '';
if ( is_multisite() && is_super_admin() )
- $actions[] = '' . __('Network Activate') . '';
+ $actions['network_activate'] = '' . __('Network Activate') . '';
if ( current_user_can('delete_plugins') )
- $actions[] = '' . __('Delete') . '';
+ $actions['plugin_delete'] = '' . __('Delete') . '';
} // end if $is_active
if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
- $actions[] = '' . __('Edit') . '';
+ $actions['edit'] = '' . __('Edit') . '';
} // end if $context
- $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
+ $actions = apply_filters( 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
$actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
$class = $is_active ? 'active' : 'inactive';