Changeset 20363
- Timestamp:
- 04/05/2012 01:05:49 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/schema.php
r20331 r20363 345 345 // If default theme is a child theme, we need to get its template 346 346 $theme = wp_get_theme( $template ); 347 if ( $theme &&! $theme->errors() )347 if ( ! $theme->errors() ) 348 348 $template = $theme->get_template(); 349 349 -
trunk/wp-includes/theme.php
r20330 r20363 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 |bool WP_Theme object. False if the theme is not found.90 * @return WP_Theme Theme object. Be sure to check the object's exists() method if you need to confirm the theme's existence. 91 91 */ 92 92 function wp_get_theme( $stylesheet = null, $theme_root = null ) { … … 105 105 } 106 106 107 $theme = new WP_Theme( $stylesheet, $theme_root ); 108 if ( $theme->exists() ) 109 return $theme; 110 111 return false; 107 return new WP_Theme( $stylesheet, $theme_root ); 112 108 } 113 109 … … 1557 1553 $old_theme = wp_get_theme( $stylesheet ); 1558 1554 1559 // If we can't find the old theme then fallback to passing the raw data to the action like we did pre-3.4 1560 if ( $old_theme ) 1555 if ( $old_theme->exists() ) 1561 1556 do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme ); 1562 1557 else
Note: See TracChangeset
for help on using the changeset viewer.