303 | | // Themes |
304 | | case 'updatethemes': |
305 | | if ( ! current_user_can( 'manage_network_themes' ) ) |
306 | | wp_die( __( 'You do not have permission to access this page.' ) ); |
307 | | |
308 | | if ( is_array( $_POST['theme'] ) ) { |
309 | | $themes = get_themes(); |
310 | | reset( $themes ); |
311 | | $allowed_themes = array(); |
312 | | foreach ( (array) $themes as $key => $theme ) { |
313 | | if ( $_POST['theme'][ esc_html( $theme['Stylesheet'] ) ] == 'enabled' ) |
314 | | $allowed_themes[ esc_html( $theme['Stylesheet'] ) ] = true; |
315 | | } |
316 | | update_site_option( 'allowedthemes', $allowed_themes ); |
317 | | } |
318 | | wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'themes' ), wp_get_referer() ) ); |
319 | | exit(); |
320 | | break; |
321 | | |