Changeset 45590 for trunk/src/wp-includes/theme.php
- Timestamp:
- 07/02/2019 11:41:16 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r45423 r45590 80 80 $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ]; 81 81 } else { 82 $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] ); 82 $themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] ); 83 $_themes[ $theme_root['theme_root'] . '/' . $theme ] = $themes[ $theme ]; 83 84 } 84 85 } … … 464 465 * @param string $cache_directory Directory to be searched for the cache. 465 466 */ 466 if ( $cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ) ) { 467 $cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ); 468 if ( $cache_expiration ) { 467 469 $cached_roots = get_site_transient( 'theme_roots' ); 468 470 if ( is_array( $cached_roots ) ) { … … 571 573 global $wp_theme_directories; 572 574 573 if ( $stylesheet_or_template && $theme_root = get_raw_theme_root( $stylesheet_or_template ) ) { 574 // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 575 // This gives relative theme roots the benefit of the doubt when things go haywire. 576 if ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) { 577 $theme_root = WP_CONTENT_DIR . $theme_root; 578 } 579 } else { 575 $theme_root = ''; 576 577 if ( $stylesheet_or_template ) { 578 $theme_root = get_raw_theme_root( $stylesheet_or_template ); 579 if ( $theme_root ) { 580 // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 581 // This gives relative theme roots the benefit of the doubt when things go haywire. 582 if ( ! in_array( $theme_root, (array) $wp_theme_directories ) ) { 583 $theme_root = WP_CONTENT_DIR . $theme_root; 584 } 585 } 586 } 587 588 if ( ! $theme_root ) { 580 589 $theme_root = WP_CONTENT_DIR . '/themes'; 581 590 } … … 1313 1322 $data = get_theme_mod( 'header_image_data' ); 1314 1323 if ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) { 1315 $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() ); 1316 $data = array(); 1317 $data['url'] = $data['thumbnail_url'] = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args ); 1324 $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() ); 1325 $data = array(); 1326 $data['url'] = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args ); 1327 $data['thumbnail_url'] = $data['url']; 1318 1328 if ( ! empty( $_wp_default_headers ) ) { 1319 1329 foreach ( (array) $_wp_default_headers as $default_header ) { … … 2901 2911 */ 2902 2912 function check_theme_switched() { 2903 if ( $stylesheet = get_option( 'theme_switched' ) ) { 2913 $stylesheet = get_option( 'theme_switched' ); 2914 if ( $stylesheet ) { 2904 2915 $old_theme = wp_get_theme( $stylesheet ); 2905 2916
Note: See TracChangeset
for help on using the changeset viewer.