Changeset 12043
- Timestamp:
- 10/15/2009 08:45:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r12042 r12043 262 262 return $wp_themes; 263 263 264 /* Register wp-content/themesas a theme directory */265 register_theme_directory( 'themes');264 /* Register the default root as a theme directory */ 265 register_theme_directory( get_theme_root() ); 266 266 267 267 if ( !$theme_files = search_theme_directories() ) … … 494 494 495 495 /** 496 * Register a directory that contains themes relative to the content directory.496 * Register a directory that contains themes. 497 497 * 498 498 * @since 2.9.0 499 499 * 500 * @param string $directory Either the full filesystem path to a theme folder or a folder within WP_CONTENT_DIR 500 501 * @return bool 501 502 */ 502 function register_theme_directory( $directory 503 function register_theme_directory( $directory) { 503 504 global $wp_theme_directories; 504 505 /* The theme directory should be relative to the content directory */ 506 $registered_directory = WP_CONTENT_DIR . '/' . $directory; 507 505 506 /* If this folder does not exist, return and do not register */ 507 if ( !file_exists( $directory ) ) 508 /* Try prepending as the theme directory could be relative to the content directory */ 509 $registered_directory = WP_CONTENT_DIR . '/' . $directory; 510 else 511 $registered_directory = $directory; 512 508 513 /* If this folder does not exist, return and do not register */ 509 514 if ( !file_exists( $registered_directory ) ) … … 524 529 function search_theme_directories() { 525 530 global $wp_theme_directories, $wp_broken_themes; 526 527 531 if ( empty( $wp_theme_directories ) ) 528 532 return false; … … 610 614 */ 611 615 function get_theme_root( $stylesheet_or_template = false ) { 612 $theme_roots = get_theme_roots(); 613 614 if ( $theme_roots[$stylesheet_or_template] ) 615 $theme_root = WP_CONTENT_DIR . '/' . $theme_roots[$stylesheet_or_template]; 616 else 616 if ($stylesheet_or_template) { 617 $theme_roots = get_theme_roots(); 618 619 if ( $theme_roots[$stylesheet_or_template] ) 620 $theme_root = WP_CONTENT_DIR . '/' . $theme_roots[$stylesheet_or_template]; 621 else 622 $theme_root = WP_CONTENT_DIR . '/themes'; 623 } else { 617 624 $theme_root = WP_CONTENT_DIR . '/themes'; 618 625 } 626 619 627 return apply_filters( 'theme_root', $theme_root ); 620 628 }
Note: See TracChangeset
for help on using the changeset viewer.