Changeset 35738 for trunk/src/wp-admin/includes/schema.php
- Timestamp:
- 11/25/2015 09:44:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/schema.php
r35688 r35738 369 369 } 370 370 371 $template = WP_DEFAULT_THEME; 372 // If default theme is a child theme, we need to get its template 373 $theme = wp_get_theme( $template ); 374 if ( ! $theme->errors() ) 375 $template = $theme->get_template(); 371 // If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme. 372 $stylesheet = $template = WP_DEFAULT_THEME; 373 $theme = wp_get_theme( WP_DEFAULT_THEME ); 374 if ( ! $theme->exists() ) { 375 $theme = WP_Theme::get_core_default_theme(); 376 } 377 378 // If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do. 379 if ( $theme ) { 380 $stylesheet = $theme->get_stylesheet(); 381 $template = $theme->get_template(); 382 } 376 383 377 384 $timezone_string = ''; … … 434 441 'recently_edited' => '', 435 442 'template' => $template, 436 'stylesheet' => WP_DEFAULT_THEME,443 'stylesheet' => $stylesheet, 437 444 'comment_whitelist' => 1, 438 445 'blacklist_keys' => '', … … 915 922 $stylesheet = get_option( 'stylesheet' ); 916 923 $allowed_themes = array( $stylesheet => true ); 917 if ( $template != $stylesheet ) 924 925 if ( $template != $stylesheet ) { 918 926 $allowed_themes[ $template ] = true; 919 if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) 927 } 928 929 if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) { 920 930 $allowed_themes[ WP_DEFAULT_THEME ] = true; 931 } 932 933 // If WP_DEFAULT_THEME doesn't exist, also whitelist the latest core default theme. 934 if ( ! wp_get_theme( WP_DEFAULT_THEME )->exists() ) { 935 if ( $core_default = WP_Theme::get_core_default_theme() ) { 936 $allowed_themes[ $core_default->get_stylesheet() ] = true; 937 } 938 } 921 939 922 940 if ( 1 == $network_id ) {
Note: See TracChangeset
for help on using the changeset viewer.