Make WordPress Core

Changeset 16193


Ignore:
Timestamp:
11/04/2010 08:11:08 PM (14 years ago)
Author:
scribu
Message:

Network Themes cleanup. Props PeteMall. See #14897

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/themes.php

    r16175 r16193  
    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 ) {
     
    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) ) {
     
    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}
Note: See TracChangeset for help on using the changeset viewer.