WordPress.org

Make WordPress Core

Changeset 15697


Ignore:
Timestamp:
10/04/10 04:26:58 (7 years ago)
Author:
dd32
Message:

Preserve search terms on plugin management pages during actions. Fixes #14905 for trunk.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/default-list-tables.php

    r15666 r15697  
    35083508 
    35093509    function display_rows() { 
    3510         global $status, $page; 
     3510        global $status, $page, $s; 
    35113511 
    35123512        $context = $status; 
     
    35583558                    if ( $is_active_for_network ) { 
    35593559                        if ( current_user_can( 'manage_network_plugins' ) ) 
    3560                             $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; 
     3560                            $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; 
    35613561                    } else { 
    35623562                        if ( current_user_can( 'manage_network_plugins' ) ) 
    3563                             $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 
     3563                            $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>'; 
    35643564                        if ( current_user_can('delete_plugins') ) 
    3565                             $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
     3565                            $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
    35663566                    } 
    35673567                } else { 
    35683568                    if ( $is_active ) { 
    3569                         $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 
     3569                        $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 
    35703570                    } else { 
    35713571                        if ( is_network_only_plugin( $plugin_file ) && !is_network_admin() ) 
    35723572                            continue; 
    35733573 
    3574                         $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 
     3574                        $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; 
    35753575 
    35763576                        if ( current_user_can('delete_plugins') ) 
    3577                             $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
     3577                            $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 
    35783578                    } // end if $is_active 
    35793579                 } // end if is_network_admin() 
  • trunk/wp-admin/plugins.php

    r15642 r15697  
    1616 
    1717$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : ''; 
     18$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; 
    1819 
    1920// Clean up request URI from temporary args for screen options/paging uri's to work as expected. 
     
    3536            if ( is_wp_error( $result ) ) { 
    3637                if ( 'unexpected_output' == $result->get_error_code() ) { 
    37                     $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin; 
     38                    $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s"; 
    3839                    wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); 
    3940                    exit; 
     
    5152                wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix 
    5253            } else { 
    53                 wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above 
     54                wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s"); // overrides the ?error=true one above 
    5455            } 
    5556            exit; 
     
    6566            $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active. 
    6667            if ( empty($plugins) ) { 
    67                 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); 
     68                wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s"); 
    6869                exit; 
    6970            } 
     
    7879            update_option('recently_activated', $recent); 
    7980 
    80             wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page"); 
     81            wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s"); 
    8182            exit; 
    8283            break; 
     
    144145            update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated')); 
    145146            if (headers_sent()) 
    146                 echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page" ) . "' />"; 
     147                echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />"; 
    147148            else 
    148                 wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page"); 
     149                wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s"); 
    149150            exit; 
    150151            break; 
     
    158159            $plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated. 
    159160            if ( empty($plugins) ) { 
    160                 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); 
     161                wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s"); 
    161162                exit; 
    162163            } 
     
    169170 
    170171            update_option('recently_activated', $deactivated + (array)get_option('recently_activated')); 
    171             wp_redirect("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page"); 
     172            wp_redirect("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s"); 
    172173            exit; 
    173174            break; 
     
    182183            $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins. 
    183184            if ( empty($plugins) ) { 
    184                 wp_redirect("plugins.php?plugin_status=$status&paged=$page"); 
     185                wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s"); 
    185186                exit; 
    186187            } 
     
    276277 
    277278            set_transient('plugins_delete_result_'.$user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length 
    278             wp_redirect("plugins.php?deleted=true&plugin_status=$status&paged=$page"); 
     279            wp_redirect("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s"); 
    279280            exit; 
    280281            break; 
Note: See TracChangeset for help on using the changeset viewer.