Changeset 56194 for trunk/src/wp-includes/theme.php
- Timestamp:
- 07/10/2023 11:09:16 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r56142 r56194 46 46 47 47 if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) { 48 // Make sure the active theme wins out, in case search_theme_directories() picks the wrong 49 // one in the case of a conflict. (Normally, last registered theme root wins.) 48 /* 49 * Make sure the active theme wins out, in case search_theme_directories() picks the wrong 50 * one in the case of a conflict. (Normally, last registered theme root wins.) 51 */ 50 52 $current_theme = get_stylesheet(); 51 53 if ( isset( $theme_directories[ $current_theme ] ) ) { … … 511 513 } 512 514 if ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) { 513 // wp-content/themes/a-single-theme 514 // wp-content/themes is $theme_root, a-single-theme is $dir. 515 /* 516 * wp-content/themes/a-single-theme 517 * wp-content/themes is $theme_root, a-single-theme is $dir. 518 */ 515 519 $found_themes[ $dir ] = array( 516 520 'theme_file' => $dir . '/style.css', … … 519 523 } else { 520 524 $found_theme = false; 521 // wp-content/themes/a-folder-of-themes/* 522 // wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs. 525 /* 526 * wp-content/themes/a-folder-of-themes/* 527 * wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs. 528 */ 523 529 $sub_dirs = @ scandir( $theme_root . '/' . $dir ); 524 530 if ( ! $sub_dirs ) { … … 539 545 $found_theme = true; 540 546 } 541 // Never mind the above, it's just a theme missing a style.css. 542 // Return it; WP_Theme will catch the error. 547 /* 548 * Never mind the above, it's just a theme missing a style.css. 549 * Return it; WP_Theme will catch the error. 550 */ 543 551 if ( ! $found_theme ) { 544 552 $found_themes[ $dir ] = array( … … 588 596 $theme_root = get_raw_theme_root( $stylesheet_or_template ); 589 597 if ( $theme_root ) { 590 // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 591 // This gives relative theme roots the benefit of the doubt when things go haywire. 598 /* 599 * Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. 600 * This gives relative theme roots the benefit of the doubt when things go haywire. 601 */ 592 602 if ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) { 593 603 $theme_root = WP_CONTENT_DIR . $theme_root; … … 1833 1843 $background = set_url_scheme( get_background_image() ); 1834 1844 1835 // $color is the saved custom color. 1836 // A default has to be specified in style.css. It will not be printed here. 1845 /* 1846 * $color is the saved custom color. 1847 * A default has to be specified in style.css. It will not be printed here. 1848 */ 1837 1849 $color = get_background_color(); 1838 1850 … … 2508 2520 break; 2509 2521 2510 // All that's left now are posts (besides attachments). 2511 // Not a default case for the sake of clarity and future work. 2522 /* 2523 * All that's left now are posts (besides attachments). 2524 * Not a default case for the sake of clarity and future work. 2525 */ 2512 2526 case 'posts': 2513 2527 foreach ( $config[ $type ] as $id => $item ) { … … 2736 2750 unset( $args[0]['__jit'] ); 2737 2751 2738 // Merge in data from previous add_theme_support() calls. 2739 // The first value registered wins. (A child theme is set up first.) 2752 /* 2753 * Merge in data from previous add_theme_support() calls. 2754 * The first value registered wins. (A child theme is set up first.) 2755 */ 2740 2756 if ( isset( $_wp_theme_features['custom-header'] ) ) { 2741 2757 $args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] ); 2742 2758 } 2743 2759 2744 // Load in the defaults at the end, as we need to insure first one wins. 2745 // This will cause all constants to be defined, as each arg will then be set to the default. 2760 /* 2761 * Load in the defaults at the end, as we need to insure first one wins. 2762 * This will cause all constants to be defined, as each arg will then be set to the default. 2763 */ 2746 2764 if ( $jit ) { 2747 2765 $args[0] = wp_parse_args( $args[0], $defaults ); … … 2790 2808 } 2791 2809 2792 // If headers are supported, and we still don't have a defined width or height, 2793 // we have implicit flex sizes. 2810 /* 2811 * If headers are supported, and we still don't have a defined width or height, 2812 * we have implicit flex sizes. 2813 */ 2794 2814 if ( $jit ) { 2795 2815 if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) { … … 3488 3508 $messenger_channel = null; 3489 3509 3490 // Value false indicates UUID should be determined after_setup_theme 3491 // to either re-use existing saved changeset or else generate a new UUID if none exists. 3510 /* 3511 * Value false indicates UUID should be determined after_setup_theme 3512 * to either re-use existing saved changeset or else generate a new UUID if none exists. 3513 */ 3492 3514 $changeset_uuid = false; 3493 3515 3494 // Set initially fo false since defaults to true for back-compat; 3495 // can be overridden via the customize_changeset_branching filter. 3516 /* 3517 * Set initially fo false since defaults to true for back-compat; 3518 * can be overridden via the customize_changeset_branching filter. 3519 */ 3496 3520 $branching = false; 3497 3521
Note: See TracChangeset
for help on using the changeset viewer.