Changeset 12129
- Timestamp:
- 10/30/2009 12:18:15 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r12128 r12129 264 264 asort( $theme_files ); 265 265 266 $wp_themes = array(); 267 266 268 foreach ( (array) $theme_files as $theme_file ) { 267 269 $theme_root = $theme_file['theme_root']; … … 309 311 if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) { 310 312 $template = "$parent_dir/$template"; 311 $template_directory = "$theme_root/$ parent_dir/$template";313 $template_directory = "$theme_root/$template"; 312 314 } else { 313 315 /** … … 317 319 $parent_theme_root = $theme_files[$template]['theme_root']; 318 320 if ( file_exists( "$parent_theme_root/$template/index.php" ) ) { 319 $template = "$parent_theme_root/$template";321 $template_directory = "$parent_theme_root/$template"; 320 322 } else { 321 323 $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.')); … … 377 379 // theme is first keeps the name. Subsequent themes get a suffix applied. 378 380 // The Default and Classic themes always trump their pretenders. 379 if ( isset($ themes[$name]) ) {381 if ( isset($wp_themes[$name]) ) { 380 382 if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) && 381 383 ('default' == $stylesheet || 'classic' == $stylesheet) ) { 382 384 // If another theme has claimed to be one of our default themes, move 383 385 // them aside. 384 $suffix = $ themes[$name]['Stylesheet'];386 $suffix = $wp_themes[$name]['Stylesheet']; 385 387 $new_name = "$name/$suffix"; 386 $ themes[$new_name] = $themes[$name];387 $ themes[$new_name]['Name'] = $new_name;388 $wp_themes[$new_name] = $wp_themes[$name]; 389 $wp_themes[$new_name]['Name'] = $new_name; 388 390 } else { 389 391 $name = "$name/$stylesheet"; … … 392 394 393 395 $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $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 ) );396 $wp_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 ) ); 395 397 } 396 398 397 /* Resolve theme dependencies. */ 398 $theme_names = array_keys( $themes ); 399 unset($theme_files); 399 400 400 401 /* Store theme roots in the DB */ 401 402 if ( get_site_transient( 'theme_roots' ) != $theme_roots ) 402 403 set_site_transient( 'theme_roots', $theme_roots, 7200 ); // cache for two hours 403 404 unset($theme_roots); 405 406 /* Resolve theme dependencies. */ 407 $theme_names = array_keys( $wp_themes ); 404 408 foreach ( (array) $theme_names as $theme_name ) { 405 $ themes[$theme_name]['Parent Theme'] = '';406 if ( $ themes[$theme_name]['Stylesheet'] != $themes[$theme_name]['Template'] ) {409 $wp_themes[$theme_name]['Parent Theme'] = ''; 410 if ( $wp_themes[$theme_name]['Stylesheet'] != $wp_themes[$theme_name]['Template'] ) { 407 411 foreach ( (array) $theme_names as $parent_theme_name ) { 408 if ( ($ themes[$parent_theme_name]['Stylesheet'] == $themes[$parent_theme_name]['Template']) && ($themes[$parent_theme_name]['Template'] == $themes[$theme_name]['Template']) ) {409 $ themes[$theme_name]['Parent Theme'] = $themes[$parent_theme_name]['Name'];412 if ( ($wp_themes[$parent_theme_name]['Stylesheet'] == $wp_themes[$parent_theme_name]['Template']) && ($wp_themes[$parent_theme_name]['Template'] == $wp_themes[$theme_name]['Template']) ) { 413 $wp_themes[$theme_name]['Parent Theme'] = $wp_themes[$parent_theme_name]['Name']; 410 414 break; 411 415 } … … 414 418 } 415 419 416 $wp_themes = $themes; 417 418 return $themes; 420 return $wp_themes; 419 421 } 420 422
Note: See TracChangeset
for help on using the changeset viewer.