Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r12135 r12226  
    317317                 * so lets use the theme root for the parent template.
    318318                 */
    319                 $parent_theme_root = $theme_files[$template]['theme_root'];
    320                 if ( file_exists( "$parent_theme_root/$template/index.php" ) ) {
    321                     $template_directory = "$parent_theme_root/$template";
     319                if ( isset($theme_files[$template]) && file_exists( $theme_files[$template]['theme_root'] . "/$template/index.php" ) ) {
     320                    $template_directory = $theme_files[$template]['theme_root'] . "/$template";
    322321                } else {
    323322                    $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
     
    367366        }
    368367
     368        //Make unique and remove duplicates when stylesheet and template are the same i.e. most themes
     369        $template_files = array_unique($template_files);
     370        $stylesheet_files = array_unique($stylesheet_files);
     371               
    369372        $template_dir = dirname($template_files[0]);
    370373        $stylesheet_dir = dirname($stylesheet_files[0]);
     
    597600            @closedir( $theme_dir );
    598601    }
    599 
    600602    return $theme_files;
    601603}
Note: See TracChangeset for help on using the changeset viewer.