WordPress.org

Make WordPress Core

Changeset 16241


Ignore:
Timestamp:
11/08/2010 07:40:05 PM (9 years ago)
Author:
ryan
Message:

Use bool for allowed themes. Props PeteMall. see #14897

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r16205 r16241  
    5959
    6060        foreach ( (array) $themes['all'] as $key => $theme ) {
    61             if ( array_key_exists( $theme['Template'], $allowed_themes ) ) {
     61            $theme_key = esc_html( $theme['Stylesheet'] );
     62            if ( isset( $allowed_themes [ $theme_key ] ) )  {
    6263                $themes['all'][$key]['enabled'] = true;
    6364                $themes['enabled'][$key] = $themes['all'][$key];
  • trunk/wp-admin/network/themes.php

    r16194 r16241  
    2424    switch ( $action ) {
    2525        case 'network-enable':
    26             $allowed_themes[ $_GET['theme'] ] = 1;
     26            $allowed_themes[ $_GET['theme'] ] = true;
    2727            update_site_option( 'allowedthemes', $allowed_themes );
    2828            wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message
     
    4242            }                       
    4343            foreach( (array) $themes as $theme )
    44                 $allowed_themes[ $theme ] = 1;
     44                $allowed_themes[ $theme ] = true;
    4545            update_site_option( 'allowedthemes', $allowed_themes );
    4646            break;
Note: See TracChangeset for help on using the changeset viewer.