Push the Delete link to the end for plugin actions. see #12741
git-svn-id: http://svn.automattic.com/wordpress/trunk@13979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6efe44acbc
commit
e9a109f34e
|
@ -523,7 +523,15 @@ function print_plugins_table($plugins, $context = '') {
|
|||
</tr>';
|
||||
}
|
||||
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[] = '<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>';
|
||||
$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[] = '<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>';
|
||||
$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[] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>';
|
||||
$actions['network_only'] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>';
|
||||
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>';
|
||||
$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() && is_super_admin() )
|
||||
$actions[] = '<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>';
|
||||
$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[] = '<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['plugin_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[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
$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', $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';
|
||||
|
|
Loading…
Reference in New Issue