From 9cbb060c0dc2981fe40f8353ce6c9a2517242d7b Mon Sep 17 00:00:00 2001 From: hardikRathi Date: Thu, 18 Dec 2025 17:29:19 +0530 Subject: [PATCH 1/2] Trac #64428: Remove default type attributes from SCRIPT and STYLE elements --- src/wp-includes/script-loader.php | 36 +++++++++++-------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 56986c3d80a79..ca04e7e97c12a 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2206,7 +2206,7 @@ function _print_scripts() { } $concat = trim( $wp_scripts->concat, ', ' ); - $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : " type='text/javascript'"; + $type_attr = ''; if ( $concat ) { if ( ! empty( $wp_scripts->print_code ) ) { @@ -2399,7 +2399,7 @@ function _print_styles() { } $concat = trim( $wp_styles->concat, ', ' ); - $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; + $type_attr = ''; if ( $concat ) { $dir = $wp_styles->text_direction; @@ -2905,12 +2905,8 @@ function wp_sanitize_script_attributes( $attributes ) { * @return string String containing `\n"; + echo "\n"; } if ( ! empty( $wp_scripts->print_html ) ) { @@ -2398,8 +2397,7 @@ function _print_styles() { $zip = 'gzip'; } - $concat = trim( $wp_styles->concat, ', ' ); - $type_attr = ''; + $concat = trim( $wp_styles->concat, ', ' ); if ( $concat ) { $dir = $wp_styles->text_direction; @@ -2414,10 +2412,10 @@ function _print_styles() { } $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver; - echo "\n"; + echo "\n"; if ( ! empty( $wp_styles->print_code ) ) { - echo "\n"; + echo "\n"; @@ -2905,9 +2903,6 @@ function wp_sanitize_script_attributes( $attributes ) { * @return string String containing `