WordPress.org

Make WordPress Core

Changeset 19251


Ignore:
Timestamp:
11/11/11 14:10:54 (2 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

Location:
trunk
Files:
3 edited

Legend:

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

    r19228 r19251  
    388388 
    389389    echo "\n\t<p>"; 
    390     if ( !empty($wp_registered_sidebars) ) { 
     390 
     391    if ( empty( $ct->stylesheet_dir ) ) { 
     392        if ( ! is_multisite() || is_super_admin() ) 
     393            echo '<span class="error-message">' . __('ERROR: The themes directory is either empty or doesn&#8217;t exist. Please check your installation.') . '</span>'; 
     394    } elseif ( ! empty($wp_registered_sidebars) ) { 
    391395        $sidebars_widgets = wp_get_sidebars_widgets(); 
    392396        $num_widgets = 0; 
  • 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; 
  • trunk/wp-includes/theme.php

    r18995 r19251  
    519519 
    520520    $themes = get_themes(); 
    521     $theme_names = array_keys($themes); 
    522     $current_template = get_option('template'); 
    523     $current_stylesheet = get_option('stylesheet'); 
    524     $current_theme = 'Twenty Ten'; 
     521    $current_theme = 'Twenty Eleven'; 
    525522 
    526523    if ( $themes ) { 
     524        $theme_names = array_keys( $themes ); 
     525        $current_template = get_option( 'template' ); 
     526        $current_stylesheet = get_option( 'stylesheet' ); 
     527 
    527528        foreach ( (array) $theme_names as $theme_name ) { 
    528529            if ( $themes[$theme_name]['Stylesheet'] == $current_stylesheet && 
Note: See TracChangeset for help on using the changeset viewer.