Changeset 61418 for trunk/src/wp-includes/theme.php
- Timestamp:
- 12/30/2025 01:01:11 PM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/theme.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r61411 r61418 1951 1951 $style .= $image . $position . $size . $repeat . $attachment; 1952 1952 } 1953 ?> 1954 <style<?php echo $type_attr; ?> id="custom-background-css"> 1955 body.custom-background { <?php echo trim( $style ); ?> } 1956 </style> 1957 <?php 1953 1954 $processor = new WP_HTML_Tag_Processor( "<style{$type_attr} id=\"custom-background-css\"></style>" ); 1955 $processor->next_tag(); 1956 1957 $style_tag_content = 'body.custom-background { ' . trim( $style ) . ' }'; 1958 $processor->set_modifiable_text( "\n{$style_tag_content}\n" ); 1959 echo "{$processor->get_updated_html()}\n"; 1958 1960 } 1959 1961 … … 1965 1967 function wp_custom_css_cb() { 1966 1968 $styles = wp_get_custom_css(); 1967 if ( $styles || is_customize_preview() ) : 1968 $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; 1969 ?> 1970 <style<?php echo $type_attr; ?> id="wp-custom-css"> 1971 <?php 1972 // Note that esc_html() cannot be used because `div > span` is not interpreted properly. 1973 echo strip_tags( $styles ); 1974 ?> 1975 </style> 1976 <?php 1977 endif; 1969 if ( ! $styles && ! is_customize_preview() ) { 1970 return; 1971 } 1972 1973 $processor = new WP_HTML_Tag_Processor( '<style></style>' ); 1974 $processor->next_tag(); 1975 if ( ! current_theme_supports( 'html5', 'style' ) ) { 1976 $processor->set_attribute( 'type', 'text/css' ); 1977 } 1978 $processor->set_attribute( 'id', 'wp-custom-css' ); 1979 $processor->set_modifiable_text( "\n{$styles}\n" ); 1980 echo "{$processor->get_updated_html()}\n"; 1978 1981 } 1979 1982
Note: See TracChangeset
for help on using the changeset viewer.