Skip to content

Commit d96ff0b

Browse files
committed
Scripts: Remove default type attribute from tags.
`SCRIPT`, `STYLE`, and stylesheet `LINK` tags do not require a type attribute since the HTML5 standard was released in 2008. Removing the type attribute simplifies logic and normalizes the produced HTML content. Developed in #10658. Follow-up to [46164]. Props hardikhuptechdev, jonsurrell, dmsnell, westonruter. Fixes #64428. See #59883, #64442. git-svn-id: https://develop.svn.wordpress.org/trunk@61411 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c22d74d commit d96ff0b

36 files changed

+359
-467
lines changed

src/wp-activate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function do_activate_header() {
100100
*/
101101
function wpmu_activate_stylesheet() {
102102
?>
103-
<style type="text/css">
103+
<style>
104104
.wp-activate-container { width: 90%; margin: 0 auto; }
105105
.wp-activate-container form { margin-top: 2em; }
106106
#submit, #key { width: 100%; font-size: 24px; box-sizing: border-box; }

src/wp-admin/includes/ajax-actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3946,7 +3946,7 @@ function wp_ajax_parse_media_shortcode() {
39463946
$styles = wpview_media_sandbox_styles();
39473947

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

39523952
if ( ! empty( $wp_scripts ) ) {

src/wp-admin/includes/plugin-install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ function install_plugin_information() {
606606
$low = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
607607
$high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
608608
?>
609-
<style type="text/css">
609+
<style>
610610
#plugin-information-title.with-banner {
611611
background-image: url( <?php echo esc_url( $low ); ?> );
612612
}

src/wp-admin/includes/privacy-tools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
451451
fwrite( $file, "<html>\n" );
452452
fwrite( $file, "<head>\n" );
453453
fwrite( $file, "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n" );
454-
fwrite( $file, "<style type='text/css'>" );
454+
fwrite( $file, '<style>' );
455455
fwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' );
456456
fwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' );
457457
fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' );

src/wp-content/themes/twentyeleven/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function twentyeleven_header_style() {
335335

336336
// If we get this far, we have custom styles. Let's do this.
337337
?>
338-
<style type="text/css" id="twentyeleven-header-css">
338+
<style id="twentyeleven-header-css">
339339
<?php
340340
// Has the text been hidden?
341341
if ( 'blank' === $text_color ) :

src/wp-content/themes/twentyeleven/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
?>
3939
</title>
4040
<link rel="profile" href="https://gmpg.org/xfn/11" />
41-
<link rel="stylesheet" type="text/css" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
41+
<link rel="stylesheet" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20251202" />
4242
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
4343
<?php
4444
/*

src/wp-content/themes/twentyfifteen/inc/custom-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function twentyfifteen_header_style() {
9595

9696
// If we get this far, we have custom styles. Let's do this.
9797
?>
98-
<style type="text/css" id="twentyfifteen-header-css">
98+
<style id="twentyfifteen-header-css">
9999
<?php
100100
// Short header for when there is no Custom Header and Header Text is hidden.
101101
if ( empty( $header_image ) && ! display_header_text() ) :

src/wp-content/themes/twentyfourteen/inc/custom-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function twentyfourteen_header_style() {
6969

7070
// If we get this far, we have custom styles.
7171
?>
72-
<style type="text/css" id="twentyfourteen-header-css">
72+
<style id="twentyfourteen-header-css">
7373
<?php
7474
// Has the text been hidden?
7575
if ( ! display_header_text() ) :

src/wp-content/themes/twentynineteen/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ function twentynineteen_colors_css_wrap() {
349349
}
350350
?>
351351

352-
<style type="text/css" id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
352+
<style id="custom-theme-colors" <?php echo is_customize_preview() ? 'data-hue="' . absint( $primary_color ) . '"' : ''; ?>>
353353
<?php echo twentynineteen_custom_colors_css(); ?>
354354
</style>
355355
<?php

src/wp-content/themes/twentyseventeen/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ function twentyseventeen_colors_css_wrap() {
443443
$customize_preview_data_hue = 'data-hue="' . $hue . '"';
444444
}
445445
?>
446-
<style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
446+
<style id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
447447
<?php echo twentyseventeen_custom_colors_css(); ?>
448448
</style>
449449
<?php

0 commit comments

Comments
 (0)