Changeset 20312 for trunk/wp-includes/theme.php
- Timestamp:
- 03/29/2012 02:59:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r20269 r20312 88 88 * @param string $theme_root Absolute path of the theme root to look in. Optional. If not specified, get_raw_theme_root() 89 89 * is used to calculate the theme root for the $stylesheet provided (or current theme). 90 * @return WP_Theme 90 * @return WP_Theme|bool WP_Theme object. False if the theme is not found. 91 91 */ 92 92 function wp_get_theme( $stylesheet = null, $theme_root = null ) { … … 98 98 if ( empty( $theme_root ) ) { 99 99 $theme_root = get_raw_theme_root( $stylesheet ); 100 if ( false === $theme_root ) 101 return false; 102 100 103 if ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) 101 104 $theme_root = WP_CONTENT_DIR . $theme_root; 102 105 } 103 106 104 return new WP_Theme( $stylesheet, $theme_root ); 107 $theme = new WP_Theme( $stylesheet, $theme_root ); 108 if ( $theme->exists() ) 109 return $theme; 110 111 return false; 105 112 } 106 113
Note: See TracChangeset
for help on using the changeset viewer.