Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function do_activate_header() {
*/
function wpmu_activate_stylesheet() {
?>
<style type="text/css">
<style>
.wp-activate-container { width: 90%; margin: 0 auto; }
.wp-activate-container form { margin-top: 2em; }
#submit, #key { width: 100%; font-size: 24px; box-sizing: border-box; }
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3946,7 +3946,7 @@ function wp_ajax_parse_media_shortcode() {
$styles = wpview_media_sandbox_styles();

foreach ( $styles as $style ) {
$head .= '<link type="text/css" rel="stylesheet" href="' . $style . '">';
$head .= '<link rel="stylesheet" href="' . $style . '">';
}

if ( ! empty( $wp_scripts ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/plugin-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ function install_plugin_information() {
$low = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
$high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
?>
<style type="text/css">
<style>
#plugin-information-title.with-banner {
background-image: url( <?php echo esc_url( $low ); ?> );
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/privacy-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
fwrite( $file, "<html>\n" );
fwrite( $file, "<head>\n" );
fwrite( $file, "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n" );
fwrite( $file, "<style type='text/css'>" );
fwrite( $file, '<style>' );
fwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' );
fwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' );
fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyeleven/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function twentyeleven_header_style() {

// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css" id="twentyeleven-header-css">
<style id="twentyeleven-header-css">
<?php
// Has the text been hidden?
if ( 'blank' === $text_color ) :
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyeleven/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
?>
</title>
<link rel="profile" href="https://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
<link rel="stylesheet" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<?php
/*
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfifteen/inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function twentyfifteen_header_style() {

// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css" id="twentyfifteen-header-css">
<style id="twentyfifteen-header-css">
<?php
// Short header for when there is no Custom Header and Header Text is hidden.
if ( empty( $header_image ) && ! display_header_text() ) :
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfourteen/inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function twentyfourteen_header_style() {

// If we get this far, we have custom styles.
?>
<style type="text/css" id="twentyfourteen-header-css">
<style id="twentyfourteen-header-css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentynineteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function twentynineteen_colors_css_wrap() {
}
?>

<style type="text/css" id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
<style id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
<?php echo twentynineteen_custom_colors_css(); ?>
</style>
<?php
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyseventeen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ function twentyseventeen_colors_css_wrap() {
$customize_preview_data_hue = 'data-hue="' . $hue . '"';
}
?>
<style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
<style id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
<?php echo twentyseventeen_custom_colors_css(); ?>
</style>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function twentyseventeen_header_style() {

// If we get this far, we have custom styles. Let's do this.
?>
<style id="twentyseventeen-custom-header-styles" type="text/css">
<style id="twentyseventeen-custom-header-styles">
<?php
// Has the text been hidden?
if ( 'blank' === $header_text_color ) :
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentysixteen/inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function twentysixteen_header_style() {

// If the header text has been hidden.
?>
<style type="text/css" id="twentysixteen-header-css">
<style id="twentysixteen-header-css">
.site-branding {
margin: 0 auto 0 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyten/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function twentyten_setup() {
*/
function twentyten_admin_header_style() {
?>
<style type="text/css" id="twentyten-admin-header-css">
<style id="twentyten-admin-header-css">
/* Shows the same border as on front end */
#headimg {
border-bottom: 1px solid #000;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyten/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
?>
</title>
<link rel="profile" href="https://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
<link rel="stylesheet" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<?php
/*
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentythirteen/inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function twentythirteen_header_style() {

// If we get this far, we have custom styles.
?>
<style type="text/css" id="twentythirteen-header-css">
<style id="twentythirteen-header-css">
<?php
if ( ! empty( $header_image ) ) :
?>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwelve/inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function twentytwelve_header_style() {

// If we get this far, we have custom styles.
?>
<style type="text/css" id="twentytwelve-header-css">
<style id="twentytwelve-header-css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
Expand Down
37 changes: 4 additions & 33 deletions src/wp-includes/class-wp-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,37 +105,12 @@ class WP_Styles extends WP_Dependencies {
*/
public $default_dirs;

/**
* Holds a string which contains the type attribute for style tag.
*
* If the active theme does not declare HTML5 support for 'style',
* then it initializes as `type='text/css'`.
*
* @since 5.3.0
* @var string
*/
private $type_attr = '';

/**
* Constructor.
*
* @since 2.6.0
*/
public function __construct() {
if (
(
function_exists( 'is_admin' ) &&
! is_admin()
)
&&
(
function_exists( 'current_theme_supports' ) &&
! current_theme_supports( 'html5', 'style' )
)
) {
$this->type_attr = " type='text/css'";
}

/**
* Fires when the WP_Styles instance is initialized.
*
Expand Down Expand Up @@ -184,9 +159,8 @@ public function do_item( $handle, $group = false ) {

if ( $inline_style ) {
$inline_style_tag = sprintf(
"<style id='%s-inline-css'%s>\n%s\n</style>\n",
"<style id='%s-inline-css'>\n%s\n</style>\n",
esc_attr( $handle ),
$this->type_attr,
$inline_style
);
} else {
Expand Down Expand Up @@ -232,12 +206,11 @@ public function do_item( $handle, $group = false ) {
$title = isset( $obj->extra['title'] ) ? $obj->extra['title'] : '';

$tag = sprintf(
"<link rel='%s' id='%s-css'%s href='%s'%s media='%s' />\n",
"<link rel='%s' id='%s-css'%s href='%s' media='%s' />\n",
$rel,
esc_attr( $handle ),
$title ? sprintf( " title='%s'", esc_attr( $title ) ) : '',
$href,
$this->type_attr,
esc_attr( $media )
);

Expand All @@ -264,12 +237,11 @@ public function do_item( $handle, $group = false ) {
}

$rtl_tag = sprintf(
"<link rel='%s' id='%s-rtl-css'%s href='%s'%s media='%s' />\n",
"<link rel='%s' id='%s-rtl-css'%s href='%s' media='%s' />\n",
$rel,
esc_attr( $handle ),
$title ? sprintf( " title='%s'", esc_attr( $title ) ) : '',
$rtl_href,
$this->type_attr,
esc_attr( $media )
);

Expand Down Expand Up @@ -365,9 +337,8 @@ public function print_inline_style( $handle, $display = true ) {
}

printf(
"<style id='%s-inline-css'%s>\n%s\n</style>\n",
"<style id='%s-inline-css'>\n%s\n</style>\n",
esc_attr( $handle ),
$this->type_attr,
$output
);

Expand Down
14 changes: 5 additions & 9 deletions src/wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -5897,10 +5897,9 @@ function _wp_theme_json_webfonts_handler() {
function print_embed_styles() {
_deprecated_function( __FUNCTION__, '6.4.0', 'wp_enqueue_embed_styles' );

$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
$suffix = SCRIPT_DEBUG ? '' : '.min';
$suffix = SCRIPT_DEBUG ? '' : '.min';
?>
<style<?php echo $type_attr; ?>>
<style>
<?php echo file_get_contents( ABSPATH . WPINC . "/css/wp-embed-template$suffix.css" ); ?>
</style>
<?php
Expand All @@ -5922,9 +5921,8 @@ function print_emoji_styles() {

$printed = true;

$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<style<?php echo $type_attr; ?>>
<style>
img.wp-smiley,
img.emoji {
display: inline !important;
Expand All @@ -5949,9 +5947,8 @@ function print_emoji_styles() {
*/
function wp_admin_bar_header() {
_deprecated_function( __FUNCTION__, '6.4.0', 'wp_enqueue_admin_bar_header_styles' );
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
<style media="print">#wpadminbar { display:none; }</style>
<?php
}

Expand All @@ -5963,9 +5960,8 @@ function wp_admin_bar_header() {
*/
function _admin_bar_bump_cb() {
_deprecated_function( __FUNCTION__, '6.4.0', 'wp_enqueue_admin_bar_bump_styles' );
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<style<?php echo $type_attr; ?> media="screen">
<style media="screen">
html { margin-top: 32px !important; }
@media screen and ( max-width: 782px ) {
html { margin-top: 46px !important; }
Expand Down
45 changes: 1 addition & 44 deletions src/wp-includes/fonts/class-wp-font-face.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,6 @@ class WP_Font_Face {
*/
private $valid_font_display = array( 'auto', 'block', 'fallback', 'swap', 'optional' );

/**
* Array of font-face style tag's attribute(s)
* where the key is the attribute name and the
* value is its value.
*
* @since 6.4.0
*
* @var string[]
*/
private $style_tag_attrs = array();

/**
* Creates and initializes an instance of WP_Font_Face.
*
* @since 6.4.0
*/
public function __construct() {
if (
function_exists( 'is_admin' ) && ! is_admin()
&&
function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )
) {
$this->style_tag_attrs = array( 'type' => 'text/css' );
}
}

/**
* Generates and prints the `@font-face` styles for the given fonts.
*
Expand Down Expand Up @@ -227,24 +201,7 @@ private function validate_font_face_declarations( array $font_face ) {
* @return string The style element.
*/
private function get_style_element() {
$attributes = $this->generate_style_element_attributes();

return "<style class='wp-fonts-local'{$attributes}>\n%s\n</style>\n";
}

/**
* Gets the defined <style> element's attributes.
*
* @since 6.4.0
*
* @return string A string of attribute=value when defined, else, empty string.
*/
private function generate_style_element_attributes() {
$attributes = '';
foreach ( $this->style_tag_attrs as $name => $value ) {
$attributes .= " {$name}='{$value}'";
}
return $attributes;
return "<style class='wp-fonts-local'>\n%s\n</style>\n";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3921,7 +3921,7 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
}
?>
<title><?php echo $title; ?></title>
<style type="text/css">
<style>
html {
background: #f1f1f1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -5061,7 +5061,7 @@ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
}

$stylesheet_link = sprintf(
"<link rel='stylesheet' href='%s' type='text/css' />\n",
"<link rel='stylesheet' href='%s' />\n",
esc_url( wp_admin_css_uri( $file ) )
);

Expand All @@ -5080,7 +5080,7 @@ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {

if ( function_exists( 'is_rtl' ) && is_rtl() ) {
$rtl_stylesheet_link = sprintf(
"<link rel='stylesheet' href='%s' type='text/css' />\n",
"<link rel='stylesheet' href='%s' />\n",
esc_url( wp_admin_css_uri( "$file-rtl" ) )
);

Expand Down
4 changes: 1 addition & 3 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -2871,10 +2871,8 @@ function gallery_shortcode( $attr ) {
* Otherwise, defaults to true.
*/
if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';

$gallery_style = "
<style{$type_attr}>
<style>
#{$selector} {
margin: auto;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/ms-deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function graceful_fail( $message ) {
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Error!</title>
<style type="text/css">
<style>
img {
border: 0;
}
Expand Down
Loading
Loading