Make WordPress Core

Ticket #14897: 14897.10.diff

File 14897.10.diff, 2.0 KB (added by PeteMall, 15 years ago)

Cleanup.

  • wp-admin/network/themes.php

     
    1414
    1515$action = $wp_list_table->current_action();
    1616
    17 $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
    1817$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
    1918
    2019// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
    21 $_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']);
     20$_SERVER['REQUEST_URI'] = remove_query_arg(array('network-enable', 'network-disable', 'network-enable-selected', 'network-disable-selected'), $_SERVER['REQUEST_URI']);
    2221
    2322if ( $action ) {
    2423        $allowed_themes = get_site_option( 'allowedthemes' );   
     
    3635                        exit;
    3736                        break;
    3837                case 'network-enable-selected':
    39                         check_admin_referer('bulk-plugins');
    40 
    4138                        $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
    4239                        if ( empty($themes) ) {
    4340                                wp_redirect( wp_get_referer() );
     
    4744                                $allowed_themes[ $theme ] = 1;
    4845                        update_site_option( 'allowedthemes', $allowed_themes );
    4946                        break;
    50                         case 'network-disable-selected':
    51                                 check_admin_referer('bulk-plugins');
    52 
    53                                 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
    54                                 if ( empty($themes) ) {
    55                                         wp_redirect( wp_get_referer() );
    56                                         exit;
    57                                 }                                               
    58                                 foreach( (array) $themes as $theme )
    59                                         unset( $allowed_themes[ $theme ] );
    60                                 update_site_option( 'allowedthemes', $allowed_themes );
    61                                 break;
    62 
     47                case 'network-disable-selected':
     48                        $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
     49                        if ( empty($themes) ) {
     50                                wp_redirect( wp_get_referer() );
     51                                exit;
     52                        }                                               
     53                        foreach( (array) $themes as $theme )
     54                                unset( $allowed_themes[ $theme ] );
     55                        update_site_option( 'allowedthemes', $allowed_themes );
     56                        break;
    6357        }
    6458}
    6559