WordPress.org

Make WordPress Core

Ticket #9835: 9835.diff

File 9835.diff, 1.6 KB (added by dd32, 9 years ago)
  • wp-admin/plugins.php

     
    1111
    1212if ( isset($_POST['clear-recent-list']) )
    1313        $action = 'clear-recent-list';
    14 elseif ( isset($_GET['action']) )
    15         $action = $_GET['action'];
    16 elseif ( isset($_POST['action']) )
    17         $action = $_POST['action'];
     14elseif ( isset($_REQUEST['action']) )
     15        $action = $_REQUEST['action'];
    1816else
    1917        $action = false;
    2018
     
    288286}
    289287
    290288$plugin_array_name = "${status}_plugins";
     289if ( empty($$plugin_array_name) && $status != 'all' ) {
     290        $status = 'all';
     291        $plugin_array_name = "${status}_plugins";
     292}
     293
    291294$plugins = &$$plugin_array_name;
    292295
    293296//Paging.
     
    363366                if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
    364367                        $actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
    365368
     369                if ( ! $is_active && current_user_can('delete_plugins') )
     370                        $actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
     371
    366372                $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
    367373                $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
    368374                $action_count = count($actions);