Ticket #14838: 14838.patch
File 14838.patch, 1.4 KB (added by , 15 years ago) |
---|
-
wp-includes/theme.php
469 469 * @return array Theme roots 470 470 */ 471 471 function get_theme_roots() { 472 $theme_roots = get_site_transient( 'theme_roots' ); 473 if ( false === $theme_roots ) { 474 get_themes(); 475 $theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme() 476 } 472 while ( false === ( $theme_roots = get_site_transient( 'theme_roots' ) ) ) 473 get_themes(); // update transient 474 477 475 return $theme_roots; 478 476 } 479 477 … … 651 649 * @return string Theme path. 652 650 */ 653 651 function get_theme_root( $stylesheet_or_template = false ) { 654 if ($stylesheet_or_template) { 655 $theme_roots = get_theme_roots(); 656 657 if ( ! empty( $theme_roots[$stylesheet_or_template] ) ) 658 $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template]; 659 else 660 $theme_root = WP_CONTENT_DIR . '/themes'; 661 } else { 662 $theme_root = WP_CONTENT_DIR . '/themes'; 663 } 664 652 653 $stylesheet_or_template 654 && ( $theme_roots = get_theme_roots() ) 655 && empty ( $theme_roots[$stylesheet_or_template] ) 656 || $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template]; 657 658 empty ( $theme_root ) && $theme_root = WP_CONTENT_DIR . '/themes'; 659 665 660 return apply_filters( 'theme_root', $theme_root ); 666 661 } 667 662