check_permissions(); $action = $wp_list_table->current_action(); $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; // Clean up request URI from temporary args for screen options/paging uri's to work as expected. $_SERVER['REQUEST_URI'] = remove_query_arg(array('enable', 'disable', 'enable-selected', 'disable-selected'), $_SERVER['REQUEST_URI']); if ( $action ) { $allowed_themes = get_site_option( 'allowedthemes' ); switch ( $action ) { case 'enable': $allowed_themes[ $_GET['theme'] ] = true; update_site_option( 'allowedthemes', $allowed_themes ); wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message exit; break; case 'disable': unset( $allowed_themes[ $_GET['theme'] ] ); update_site_option( 'allowedthemes', $allowed_themes ); wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message exit; break; case 'enable-selected': $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); if ( empty($themes) ) { wp_redirect( wp_get_referer() ); exit; } foreach( (array) $themes as $theme ) $allowed_themes[ $theme ] = true; update_site_option( 'allowedthemes', $allowed_themes ); break; case 'disable-selected': $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); if ( empty($themes) ) { wp_redirect( wp_get_referer() ); exit; } foreach( (array) $themes as $theme ) unset( $allowed_themes[ $theme ] ); update_site_option( 'allowedthemes', $allowed_themes ); break; } } $wp_list_table->prepare_items(); add_thickbox(); add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) ); add_contextual_help($current_screen, '

' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '

' . '

' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site’s Appearance > Themes screen.') . '

' . '

' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen.') . '

' . '

' . __('For more information:') . '

' . '

' . __('Documentation on Network Themes') . '

' . '

' . __('Support Forums') . '

' ); $title = __('Themes'); $parent_file = 'themes.php'; require_once(ABSPATH . 'wp-admin/admin-header.php'); ?>

views(); ?>
display(); ?>