Changeset 20118
- Timestamp:
- 03/06/2012 01:50:54 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r20116 r20118 399 399 $found_themes = array(); 400 400 401 // Set up maybe-relative, maybe-absolute array of theme directories. 402 // We always want to return absolute, but we need to cache relative 403 // use in for get_theme_root(). 404 foreach ( $wp_theme_directories as $theme_root ) { 405 if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) 406 $relative_theme_roots[ str_replace( WP_CONTENT_DIR, '', $theme_root ) ] = $theme_root; 407 else 408 $relative_theme_roots[ $theme_root ] = $theme_root; 409 } 410 401 411 if ( $cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ) ) { 402 412 $cached_roots = get_site_transient( 'theme_roots' ); … … 405 415 $found_themes[ $theme_dir ] = array( 406 416 'theme_file' => $theme_dir . '/style.css', 407 'theme_root' => $ theme_root,417 'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute. 408 418 ); 409 419 } … … 466 476 467 477 $theme_roots = array(); 478 $relative_theme_roots = array_flip( $relative_theme_roots ); 479 468 480 foreach ( $found_themes as $theme_dir => $theme_data ) { 469 $theme_roots[ $theme_dir ] = $ theme_data['theme_root'];481 $theme_roots[ $theme_dir ] = $relative_theme_roots[ $theme_data['theme_root'] ]; // Convert absolute to relative. 470 482 } 471 483
Note: See TracChangeset
for help on using the changeset viewer.