Make WordPress Core


Ignore:
Timestamp:
11/11/2011 02:10:54 PM (14 years ago)
Author:
ryan
Message:

Avoid notice when themes dir is empty or missing. Don't reset current theme in current_theme_info() if there are no themes. Show warning in Right Now if there are no themes. Props azaozz. fixes #19089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/theme.php

    r18563 r19251  
    1717    $themes = get_themes();
    1818    $current_theme = get_current_theme();
     19
     20    if ( ! $themes ) {
     21        $ct = new stdClass;
     22        $ct->name = $current_theme;
     23        return $ct;
     24    }
     25
    1926    if ( ! isset( $themes[$current_theme] ) ) {
    2027        delete_option( 'current_theme' );
    2128        $current_theme = get_current_theme();
    2229    }
     30
    2331    $ct = new stdClass;
    2432    $ct->name = $current_theme;
Note: See TracChangeset for help on using the changeset viewer.