Changeset 12118
- Timestamp:
- 10/27/2009 05:17:23 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/theme.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r12117 r12118 297 297 298 298 if ( empty($template) ) { 299 if ( file_exists( dirname("$theme_root/$theme_file/index.php")) )300 $template = dirname($theme_file);299 if ( file_exists("$theme_root/$stylesheet/index.php") ) 300 $template = $stylesheet; 301 301 else 302 302 continue; … … 308 308 $parent_dir = dirname(dirname($theme_file)); 309 309 if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) { 310 $template = "$theme_root/$parent_dir/$template"; 310 $template = "$parent_dir/$template"; 311 $template_directory = "$theme_root/$parent_dir/$template"; 311 312 } else { 312 313 /** … … 324 325 } 325 326 } else { 326 $template = trim( $theme_root . '/' . $template );327 $template_directory = trim( $theme_root . '/' . $template ); 327 328 } 328 329 … … 343 344 } 344 345 345 $template_dir = @ dir("$template ");346 $template_dir = @ dir("$template_directory"); 346 347 if ( $template_dir ) { 347 348 while ( ($file = $template_dir->read()) !== false ) { … … 349 350 continue; 350 351 if ( preg_match('|\.php$|', $file) ) { 351 $template_files[] = "$template /$file";352 } elseif ( is_dir("$template /$file") ) {353 $template_subdir = @ dir("$template /$file");352 $template_files[] = "$template_directory/$file"; 353 } elseif ( is_dir("$template_directory/$file") ) { 354 $template_subdir = @ dir("$template_directory/$file"); 354 355 while ( ($subfile = $template_subdir->read()) !== false ) { 355 356 if ( preg_match('|^\.+$|', $subfile) ) 356 357 continue; 357 358 if ( preg_match('|\.php$|', $subfile) ) 358 $template_files[] = "$template /$file/$subfile";359 $template_files[] = "$template_directory/$file/$subfile"; 359 360 } 360 361 @ $template_subdir->close(); … … 391 392 392 393 $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root ); 393 $themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => basename( $template ), 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) );394 $themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) ); 394 395 } 395 396
Note: See TracChangeset
for help on using the changeset viewer.