@@ 103-109 (lines=7) @@ | ||
100 | if ( empty( $stylesheet ) ) |
|
101 | $stylesheet = get_stylesheet(); |
|
102 | ||
103 | if ( empty( $theme_root ) ) { |
|
104 | $theme_root = get_raw_theme_root( $stylesheet ); |
|
105 | if ( false === $theme_root ) |
|
106 | $theme_root = WP_CONTENT_DIR . '/themes'; |
|
107 | elseif ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) |
|
108 | $theme_root = WP_CONTENT_DIR . $theme_root; |
|
109 | } |
|
110 | ||
111 | return new WP_Theme( $stylesheet, $theme_root ); |
|
112 | } |
|
@@ 545-552 (lines=8) @@ | ||
542 | function get_theme_root( $stylesheet_or_template = false ) { |
|
543 | global $wp_theme_directories; |
|
544 | ||
545 | if ( $stylesheet_or_template && $theme_root = get_raw_theme_root( $stylesheet_or_template ) ) { |
|
546 | // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. |
|
547 | // This gives relative theme roots the benefit of the doubt when things go haywire. |
|
548 | if ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) |
|
549 | $theme_root = WP_CONTENT_DIR . $theme_root; |
|
550 | } else { |
|
551 | $theme_root = WP_CONTENT_DIR . '/themes'; |
|
552 | } |
|
553 | ||
554 | /** |
|
555 | * Filters the absolute path to the themes directory. |