WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/18/2010 11:34:36 PM (10 years ago)
Author:
ryan
Message:

Multisite and formatting cleanups. Introduce get_allowed_themes(). see #11644

File:
1 edited

Legend:

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

    r12754 r12755  
    1313    wp_die( __( 'Cheatin’ uh?' ) );
    1414
    15 if ( is_multisite() ) {
    16     $themes = get_themes();
    17     $ct = current_theme_info();
    18     $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() );
    19     if ( $allowed_themes == false )
    20         $allowed_themes = array();
    21 
    22     $blog_allowed_themes = wpmu_get_blog_allowedthemes();
    23     if ( is_array( $blog_allowed_themes ) )
    24         $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );
    25     if ( $blog_id != 1 )
    26         unset( $allowed_themes[ "h3" ] );
    27 
    28     if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )
    29         $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true;
    30 
    31     reset( $themes );
    32     foreach ( $themes as $key => $theme ) {
    33         if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {
    34             unset( $themes[ $key ] );
    35         }
    36     }
    37     reset( $themes );
    38 }
    3915if ( isset($_GET['action']) ) {
    4016    if ( 'activate' == $_GET['action'] ) {
     
    8662
    8763<?php
    88 if ( !is_multisite() )
    89     $themes = get_themes();
     64$themes = get_allowed_themes();
    9065$ct = current_theme_info();
    9166unset($themes[$ct->name]);
Note: See TracChangeset for help on using the changeset viewer.