Commit e160907f43 for wordpress.org
commit e160907f438142f75b641305eb7a3fd1dac0b5a2
Author: jonsurrell <jonsurrell@git.wordpress.org>
Date: Mon Jan 5 16:04:58 2026 +0000
Scripts: Remove default attributes 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 https://github.com/WordPress/wordpress-develop/pull/10664.
Follow-up to [61411], [46164].
Props jonsurrell, sabernhardt, westonruter.
Fixes #64428. See #59883, #64442.
Built from https://develop.svn.wordpress.org/trunk@61440
git-svn-id: http://core.svn.wordpress.org/trunk@60752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/readme.html b/readme.html
index e1528c1ac6..8696b0505a 100644
--- a/readme.html
+++ b/readme.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<title>WordPress › ReadMe</title>
- <link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" type="text/css" />
+ <link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" />
</head>
<body>
<h1 id="logo">
diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php
index c688f1a891..abb020e046 100644
--- a/wp-admin/admin-footer.php
+++ b/wp-admin/admin-footer.php
@@ -114,6 +114,6 @@ if ( function_exists( 'get_site_option' )
?>
<div class="clear"></div></div><!-- wpwrap -->
-<script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
+<script>if(typeof wpOnload==='function')wpOnload();</script>
</body>
</html>
diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index ea0245fdb1..0c075d6827 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -101,7 +101,7 @@ wp_enqueue_script( 'svg-painter' );
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
?>
-<script type="text/javascript">
+<script>
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
@@ -253,7 +253,7 @@ $admin_body_classes = apply_filters( 'admin_body_class', '' );
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
?>
<body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>">
-<script type="text/javascript">
+<script>
document.body.className = document.body.className.replace('no-js','js');
</script>
diff --git a/wp-admin/customize.php b/wp-admin/customize.php
index 141fb93dc3..1f1a9d38b1 100644
--- a/wp-admin/customize.php
+++ b/wp-admin/customize.php
@@ -159,7 +159,7 @@ $admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loadi
?>
<title><?php echo esc_html( $admin_title ); ?></title>
-<script type="text/javascript">
+<script>
var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>,
pagenow = 'customize';
</script>
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index a22acd74cc..c509202954 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -769,7 +769,7 @@ if ( post_type_supports( $post_type, 'comments' ) ) {
?>
<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
-<script type="text/javascript">
+<script>
try{document.post.title.focus();}catch(e){}
</script>
<?php endif; ?>
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php
index 47b44ee31d..cb6ab78e8f 100644
--- a/wp-admin/edit-form-comment.php
+++ b/wp-admin/edit-form-comment.php
@@ -283,7 +283,7 @@ $referer = wp_get_referer();
</form>
<?php if ( ! wp_is_mobile() ) : ?>
-<script type="text/javascript">
+<script>
try{document.post.name.focus();}catch(e){}
</script>
<?php
diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php
index ec40fcc52e..4373c0a67f 100644
--- a/wp-admin/edit-tag-form.php
+++ b/wp-admin/edit-tag-form.php
@@ -312,7 +312,7 @@ do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
</div>
<?php if ( ! wp_is_mobile() ) : ?>
-<script type="text/javascript">
+<script>
try{document.forms.edittag.name.focus();}catch(e){}
</script>
<?php
diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php
index 74381c0ec8..6efdeb9b05 100644
--- a/wp-admin/edit-tags.php
+++ b/wp-admin/edit-tags.php
@@ -689,7 +689,7 @@ if ( $can_edit_terms ) {
</div><!-- /wrap -->
<?php if ( ! wp_is_mobile() ) : ?>
-<script type="text/javascript">
+<script>
try{document.forms.addtag['tag-name'].focus();}catch(e){}
</script>
<?php
diff --git a/wp-admin/export.php b/wp-admin/export.php
index 945eb590d0..d43a0e689a 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -26,7 +26,7 @@ $title = __( 'Export' );
*/
function export_add_js() {
?>
-<script type="text/javascript">
+<script>
jQuery( function($) {
var form = $('#export-filters'),
filters = form.find('.export-filters');
diff --git a/wp-admin/includes/class-bulk-upgrader-skin.php b/wp-admin/includes/class-bulk-upgrader-skin.php
index 5cdd2a56ce..f406d160e4 100644
--- a/wp-admin/includes/class-bulk-upgrader-skin.php
+++ b/wp-admin/includes/class-bulk-upgrader-skin.php
@@ -141,7 +141,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
}
$this->error = implode( ', ', $messages );
}
- echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
+ echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
}
/**
@@ -172,7 +172,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
public function before( $title = '' ) {
$this->in_loop = true;
printf( '<h2>' . $this->upgrader->strings['skin_before_update_header'] . ' <span class="spinner waiting-' . $this->upgrader->update_current . '"></span></h2>', $title, $this->upgrader->update_current, $this->upgrader->update_count );
- echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
+ echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
// This progress messages div gets moved via JavaScript when clicking on "More details.".
echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr( $this->upgrader->update_current ) . '"><p>';
$this->flush_output();
@@ -200,7 +200,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
)
);
- echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
+ echo '<script>jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
}
if ( $this->result && ! is_wp_error( $this->result ) ) {
if ( ! $this->error ) {
@@ -210,7 +210,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
'</p></div>';
}
- echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
+ echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
}
$this->reset();
diff --git a/wp-admin/includes/class-custom-image-header.php b/wp-admin/includes/class-custom-image-header.php
index e8a16e47dc..d6a5e823c8 100644
--- a/wp-admin/includes/class-custom-image-header.php
+++ b/wp-admin/includes/class-custom-image-header.php
@@ -376,7 +376,7 @@ class Custom_Image_Header {
}
}
?>
-<script type="text/javascript">
+<script>
(function($){
var default_color = '<?php echo esc_js( $default_color ); ?>',
header_text_fields;
@@ -431,7 +431,7 @@ class Custom_Image_Header {
public function js_2() {
?>
-<script type="text/javascript">
+<script>
function onEndCrop( coords ) {
jQuery( '#x1' ).val(coords.x);
jQuery( '#y1' ).val(coords.y);
diff --git a/wp-admin/includes/class-wp-internal-pointers.php b/wp-admin/includes/class-wp-internal-pointers.php
index 09dc56ae35..9a2135b527 100644
--- a/wp-admin/includes/class-wp-internal-pointers.php
+++ b/wp-admin/includes/class-wp-internal-pointers.php
@@ -118,7 +118,7 @@ final class WP_Internal_Pointers {
}
?>
- <script type="text/javascript">
+ <script>
(function($){
var options = <?php echo wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>, setup;
diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php
index 6568b1563b..63f2748f7f 100644
--- a/wp-admin/includes/class-wp-list-table.php
+++ b/wp-admin/includes/class-wp-list-table.php
@@ -1871,6 +1871,6 @@ class WP_List_Table {
),
);
- printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
+ printf( "<script>list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
}
}
diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php
index d7c491bd1c..c8cdbab8e4 100644
--- a/wp-admin/includes/class-wp-themes-list-table.php
+++ b/wp-admin/includes/class-wp-themes-list-table.php
@@ -357,7 +357,7 @@ class WP_Themes_List_Table extends WP_List_Table {
$args = array_merge( $args, $extra_args );
}
- printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
+ printf( "<script>var theme_list_args = %s;</script>\n", wp_json_encode( $args, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) );
parent::_js_vars();
}
}
diff --git a/wp-admin/includes/class-wp-upgrader-skin.php b/wp-admin/includes/class-wp-upgrader-skin.php
index a5c80fad6d..831da3aeba 100644
--- a/wp-admin/includes/class-wp-upgrader-skin.php
+++ b/wp-admin/includes/class-wp-upgrader-skin.php
@@ -245,7 +245,7 @@ class WP_Upgrader_Skin {
}
if ( defined( 'IFRAME_REQUEST' ) ) {
- echo '<script type="text/javascript">
+ echo '<script>
if ( window.postMessage && JSON ) {
window.parent.postMessage(
JSON.stringify( {
@@ -258,7 +258,7 @@ class WP_Upgrader_Skin {
}
</script>';
} else {
- echo '<script type="text/javascript">
+ echo '<script>
(function( wp ) {
if ( wp && wp.updates && wp.updates.decrementCount ) {
wp.updates.decrementCount( "' . $type . '" );
diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php
index 2f9b034e55..86524fb897 100644
--- a/wp-admin/includes/deprecated.php
+++ b/wp-admin/includes/deprecated.php
@@ -1511,7 +1511,7 @@ function post_form_autocomplete_off() {
*/
function options_permalink_add_js() {
?>
- <script type="text/javascript">
+ <script>
jQuery( function() {
jQuery('.permalink-structure input:radio').change(function() {
if ( 'custom' == this.value )
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 210539681a..375c9c812d 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -272,7 +272,7 @@ function _cleanup_image_add_caption( $matches ) {
*/
function media_send_to_editor( $html ) {
?>
- <script type="text/javascript">
+ <script>
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor( <?php echo wp_json_encode( $html, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
</script>
@@ -550,7 +550,7 @@ function wp_iframe( $content_func, ...$args ) {
}
?>
- <script type="text/javascript">
+ <script>
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
isRtl = <?php echo (int) is_rtl(); ?>;
@@ -612,7 +612,7 @@ function wp_iframe( $content_func, ...$args ) {
?>
</head>
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
- <script type="text/javascript">
+ <script>
document.body.className = document.body.className.replace('no-js', 'js');
</script>
<?php
@@ -623,7 +623,7 @@ function wp_iframe( $content_func, ...$args ) {
do_action( 'admin_print_footer_scripts' );
?>
- <script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
+ <script>if(typeof wpOnload==='function')wpOnload();</script>
</body>
</html>
<?php
@@ -821,7 +821,7 @@ function media_upload_form_handler() {
if ( isset( $_POST['insert-gallery'] ) || isset( $_POST['update-gallery'] ) ) {
?>
- <script type="text/javascript">
+ <script>
var win = window.dialogArguments || opener || parent || top;
win.tb_remove();
</script>
@@ -2070,7 +2070,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
function media_upload_header() {
$post_id = isset( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0;
- echo '<script type="text/javascript">post_id = ' . $post_id . ';</script>';
+ echo '<script>post_id = ' . $post_id . ';</script>';
if ( empty( $_GET['chromeless'] ) ) {
echo '<div id="media-upload-header">';
@@ -2219,7 +2219,7 @@ function media_upload_form( $errors = null ) {
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
?>
- <script type="text/javascript">
+ <script>
<?php
// Verify size is an int. If not return default value.
$large_size_h = absint( get_option( 'large_size_h' ) );
@@ -2361,7 +2361,7 @@ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
<?php media_upload_form( $errors ); ?>
- <script type="text/javascript">
+ <script>
jQuery(function($){
var preloaded = $(".media-item.preloaded");
if ( preloaded.length > 0 ) {
@@ -2427,7 +2427,7 @@ function media_upload_type_url_form( $type = null, $errors = null, $id = null )
<h3 class="media-title"><?php _e( 'Insert media from another website' ); ?></h3>
- <script type="text/javascript">
+ <script>
var addExtImage = {
width : '',
@@ -2568,7 +2568,7 @@ function media_upload_gallery_form( $errors ) {
}
?>
- <script type="text/javascript">
+ <script>
jQuery(function($){
var preloaded = $(".media-item.preloaded");
if ( preloaded.length > 0 ) {
@@ -2896,7 +2896,7 @@ function media_upload_library_form( $errors ) {
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form">
<?php wp_nonce_field( 'media-form' ); ?>
- <script type="text/javascript">
+ <script>
jQuery(function($){
var preloaded = $(".media-item.preloaded");
if ( preloaded.length > 0 ) {
diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
index 52f43d0b68..68f0717b88 100644
--- a/wp-admin/includes/meta-boxes.php
+++ b/wp-admin/includes/meta-boxes.php
@@ -914,7 +914,7 @@ function post_comment_meta_box( $post ) {
$hidden = get_hidden_meta_boxes( get_current_screen() );
if ( ! in_array( 'commentsdiv', $hidden, true ) ) {
?>
- <script type="text/javascript">jQuery(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
+ <script>jQuery(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php
}
diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php
index 2454aad1c8..df95166788 100644
--- a/wp-admin/includes/misc.php
+++ b/wp-admin/includes/misc.php
@@ -1080,7 +1080,7 @@ function wp_color_scheme_settings() {
);
}
- echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ";</script>\n";
+ echo '<script>var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ";</script>\n";
}
/**
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 10ed2e2769..bef197410b 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -847,7 +847,7 @@ function can_edit_network( $network_id ) {
*/
function _thickbox_path_admin_subfolder() {
?>
-<script type="text/javascript">
+<script>
var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>";
</script>
<?php
@@ -1010,7 +1010,7 @@ function confirm_delete_users( $users ) {
*/
function network_settings_add_js() {
?>
-<script type="text/javascript">
+<script>
jQuery( function($) {
var languageSelect = $( '#WPLANG' );
$( 'form' ).on( 'submit', function() {
diff --git a/wp-admin/includes/options.php b/wp-admin/includes/options.php
index f4a44e57f2..5742e3ccc1 100644
--- a/wp-admin/includes/options.php
+++ b/wp-admin/includes/options.php
@@ -33,7 +33,7 @@ function options_discussion_add_js() {
*/
function options_general_add_js() {
?>
-<script type="text/javascript">
+<script>
jQuery( function($) {
var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
$siteIconPreview = $('#site-icon-preview-site-title'),
@@ -112,7 +112,7 @@ function options_general_add_js() {
*/
function options_reading_add_js() {
?>
-<script type="text/javascript">
+<script>
jQuery( function($) {
var section = $('#front-static-pages'),
staticPage = section.find('input:radio[value="page"]'),
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index fdd873a888..d5034b3ce0 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -2460,7 +2460,7 @@ function the_block_editor_meta_boxes() {
* will not be printed again after this point.
*/
if ( wp_script_is( 'wp-edit-post', 'done' ) ) {
- printf( "<script type='text/javascript'>\n%s\n</script>\n", trim( $script ) );
+ printf( "<script>\n%s\n</script>\n", trim( $script ) );
}
/*
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index adb12bc24b..2eaf674543 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -2138,7 +2138,7 @@ function iframe_header( $title = '', $deprecated = false ) {
<?php
wp_enqueue_style( 'colors' );
?>
-<script type="text/javascript">
+<script>
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
@@ -2187,7 +2187,7 @@ var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
?>
<body <?php echo $admin_body_id; ?>class="wp-admin wp-core-ui no-js iframe <?php echo esc_attr( $admin_body_classes ); ?>">
-<script type="text/javascript">
+<script>
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
@@ -2226,7 +2226,7 @@ function iframe_footer() {
do_action( 'admin_print_footer_scripts' );
?>
</div>
-<script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
+<script>if(typeof wpOnload==='function')wpOnload();</script>
</body>
</html>
<?php
@@ -2495,7 +2495,7 @@ function get_media_states( $post ) {
*/
function compression_test() {
?>
- <script type="text/javascript">
+ <script>
var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>;
var testCompression = {
get : function(test) {
diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php
index cfe17fd744..8c00c80da1 100644
--- a/wp-admin/includes/update-core.php
+++ b/wp-admin/includes/update-core.php
@@ -1720,7 +1720,7 @@ function _redirect_to_about_wordpress( $new_version ) {
);
echo '</div>';
?>
-<script type="text/javascript">
+<script>
window.location = 'about.php?updated';
</script>
<?php
diff --git a/wp-admin/install.php b/wp-admin/install.php
index 1bd34a4973..7fcacab9bd 100644
--- a/wp-admin/install.php
+++ b/wp-admin/install.php
@@ -470,13 +470,13 @@ switch ( $step ) {
if ( ! wp_is_mobile() ) {
?>
-<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
+<script>var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
<?php
}
wp_print_scripts( $scripts_to_print );
?>
-<script type="text/javascript">
+<script>
jQuery( function( $ ) {
$( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
} );
diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php
index 389817a0fe..448c1c7914 100644
--- a/wp-admin/media-new.php
+++ b/wp-admin/media-new.php
@@ -77,7 +77,7 @@ if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) {
<?php media_upload_form(); ?>
- <script type="text/javascript">
+ <script>
var post_id = <?php echo absint( $post_id ); ?>, shortform = 3;
</script>
<input type="hidden" name="post_id" id="post_id" value="<?php echo absint( $post_id ); ?>" />
diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php
index 723a938250..070a8472e4 100644
--- a/wp-admin/network/site-users.php
+++ b/wp-admin/network/site-users.php
@@ -236,7 +236,7 @@ if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
-<script type="text/javascript">
+<script>
var current_site_id = <?php echo absint( $id ); ?>;
</script>
diff --git a/wp-admin/network/upgrade.php b/wp-admin/network/upgrade.php
index 79e40f45fb..f4e65b2e9b 100644
--- a/wp-admin/network/upgrade.php
+++ b/wp-admin/network/upgrade.php
@@ -124,7 +124,7 @@ switch ( $action ) {
}
echo '</ul>';
?><p><?php _e( 'If your browser does not start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Sites' ); ?></a></p>
- <script type="text/javascript">
+ <script>
<!--
function nextpage() {
location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>";
diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php
index aab3bdd259..17094849a1 100644
--- a/wp-admin/update-core.php
+++ b/wp-admin/update-core.php
@@ -210,7 +210,7 @@ function dismissed_updates() {
$show_text = esc_js( __( 'Show hidden updates' ) );
$hide_text = esc_js( __( 'Hide hidden updates' ) );
?>
- <script type="text/javascript">
+ <script>
jQuery( function( $ ) {
$( '#show-dismissed' ).on( 'click', function() {
var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
@@ -935,7 +935,7 @@ function do_core_upgrade( $reinstall = false ) {
);
?>
</div>
- <script type="text/javascript">
+ <script>
window.location = '<?php echo esc_url( self_admin_url( 'about.php?updated' ) ); ?>';
</script>
<?php
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index 561dea1a99..b812fc8935 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -967,13 +967,13 @@ switch ( $action ) {
break;
}
?>
-<script type="text/javascript">
+<script>
if (window.location.hash == '#password') {
document.getElementById('pass1').focus();
}
</script>
-<script type="text/javascript">
+<script>
jQuery( function( $ ) {
var languageSelect = $( '#locale' );
$( 'form' ).on( 'submit', function() {
diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php
index 87646ad0c0..900c1f2cf2 100644
--- a/wp-content/themes/twentyeleven/functions.php
+++ b/wp-content/themes/twentyeleven/functions.php
@@ -369,7 +369,7 @@ if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) :
*/
function twentyeleven_admin_header_style() {
?>
- <style type="text/css" id="twentyeleven-admin-header-css">
+ <style id="twentyeleven-admin-header-css">
.appearance_page_custom-header #headimg {
border: none;
}
diff --git a/wp-content/themes/twentyfifteen/js/customize-preview.js b/wp-content/themes/twentyfifteen/js/customize-preview.js
index 58ca269a68..37fa93ecdf 100644
--- a/wp-content/themes/twentyfifteen/js/customize-preview.js
+++ b/wp-content/themes/twentyfifteen/js/customize-preview.js
@@ -7,7 +7,7 @@
api = wp.customize;
if ( ! $style.length ) {
- $style = $( 'head' ).append( '<style type="text/css" id="twentyfifteen-color-scheme-css" />' )
+ $style = $( 'head' ).append( '<style id="twentyfifteen-color-scheme-css" />' )
.find( '#twentyfifteen-color-scheme-css' );
}
diff --git a/wp-content/themes/twentyfourteen/inc/custom-header.php b/wp-content/themes/twentyfourteen/inc/custom-header.php
index c6e726659c..5569accc17 100644
--- a/wp-content/themes/twentyfourteen/inc/custom-header.php
+++ b/wp-content/themes/twentyfourteen/inc/custom-header.php
@@ -103,7 +103,7 @@ if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) :
*/
function twentyfourteen_admin_header_style() {
?>
- <style type="text/css" id="twentyfourteen-admin-header-css">
+ <style id="twentyfourteen-admin-header-css">
.appearance_page_custom-header #headimg {
background-color: #000;
border: none;
diff --git a/wp-content/themes/twentysixteen/js/customize-preview.js b/wp-content/themes/twentysixteen/js/customize-preview.js
index fc99333c29..216d31b614 100644
--- a/wp-content/themes/twentysixteen/js/customize-preview.js
+++ b/wp-content/themes/twentysixteen/js/customize-preview.js
@@ -7,7 +7,7 @@
api = wp.customize;
if ( ! style.length ) {
- style = $( 'head' ).append( '<style type="text/css" id="twentysixteen-color-scheme-css" />' )
+ style = $( 'head' ).append( '<style id="twentysixteen-color-scheme-css" />' )
.find( '#twentysixteen-color-scheme-css' );
}
diff --git a/wp-content/themes/twentyten/404.php b/wp-content/themes/twentyten/404.php
index c67f6ca502..64888d9f12 100644
--- a/wp-content/themes/twentyten/404.php
+++ b/wp-content/themes/twentyten/404.php
@@ -22,7 +22,7 @@ get_header(); ?>
</div><!-- #content -->
</div><!-- #container -->
- <script type="text/javascript">
+ <script>
// Focus on search field after it has loaded.
document.getElementById('s') && document.getElementById('s').focus();
</script>
diff --git a/wp-content/themes/twentythirteen/inc/custom-header.php b/wp-content/themes/twentythirteen/inc/custom-header.php
index 6fb43f49c7..f293a46a46 100644
--- a/wp-content/themes/twentythirteen/inc/custom-header.php
+++ b/wp-content/themes/twentythirteen/inc/custom-header.php
@@ -154,7 +154,7 @@ function twentythirteen_header_style() {
function twentythirteen_admin_header_style() {
$header_image = get_header_image();
?>
- <style type="text/css" id="twentythirteen-admin-header-css">
+ <style id="twentythirteen-admin-header-css">
.appearance_page_custom-header #headimg {
border: none;
-webkit-box-sizing: border-box;
diff --git a/wp-content/themes/twentytwelve/inc/custom-header.php b/wp-content/themes/twentytwelve/inc/custom-header.php
index fc5f8268d1..d7297cf0de 100644
--- a/wp-content/themes/twentytwelve/inc/custom-header.php
+++ b/wp-content/themes/twentytwelve/inc/custom-header.php
@@ -107,7 +107,7 @@ function twentytwelve_header_style() {
*/
function twentytwelve_admin_header_style() {
?>
- <style type="text/css" id="twentytwelve-admin-header-css">
+ <style id="twentytwelve-admin-header-css">
.appearance_page_custom-header #headimg {
border: none;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php
index 925d9d0b56..7ddd60fe87 100644
--- a/wp-includes/class-wp-editor.php
+++ b/wp-includes/class-wp-editor.php
@@ -978,7 +978,7 @@ final class _WP_Editors {
}
?>
- <script type="text/javascript">
+ <script>
window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
window.wp.editor.getDefaultSettings = function() {
@@ -1563,7 +1563,7 @@ final class _WP_Editors {
wp_print_scripts( array( 'wp-tinymce' ) );
- echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
+ echo "<script>\n" . self::wp_mce_translation() . "</script>\n";
}
/**
@@ -1620,7 +1620,7 @@ final class _WP_Editors {
do_action( 'before_wp_tiny_mce', self::$mce_settings );
?>
- <script type="text/javascript">
+ <script>
tinyMCEPreInit = {
baseURL: "<?php echo $baseurl; ?>",
suffix: "<?php echo $suffix; ?>",
@@ -1644,7 +1644,7 @@ final class _WP_Editors {
if ( self::$ext_plugins ) {
// Load the old-format English strings to prevent unsightly labels in old style popups.
- echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n";
+ echo "<script src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n";
}
}
@@ -1659,7 +1659,7 @@ final class _WP_Editors {
do_action( 'wp_tiny_mce_init', self::$mce_settings );
?>
- <script type="text/javascript">
+ <script>
<?php
if ( self::$ext_plugins ) {
diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php
index 7519b0bf77..bf13f187df 100644
--- a/wp-includes/class-wp-embed.php
+++ b/wp-includes/class-wp-embed.php
@@ -88,7 +88,7 @@ class WP_Embed {
return;
}
?>
-<script type="text/javascript">
+<script>
jQuery( function($) {
$.get("<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ) . '?action=oembed-cache&post=' . $post->ID; ?>");
} );
diff --git a/wp-includes/css/dist/index.php b/wp-includes/css/dist/index.php
index 891157ecaa..7b496974b9 100644
--- a/wp-includes/css/dist/index.php
+++ b/wp-includes/css/dist/index.php
@@ -22,6 +22,11 @@ return array(
'path' => 'preferences/style',
'dependencies' => array('wp-components'),
),
+ array(
+ 'handle' => 'wp-commands',
+ 'path' => 'commands/style',
+ 'dependencies' => array('wp-components'),
+ ),
array(
'handle' => 'wp-reusable-blocks',
'path' => 'reusable-blocks/style',
@@ -32,11 +37,6 @@ return array(
'path' => 'patterns/style',
'dependencies' => array('wp-block-editor', 'wp-components'),
),
- array(
- 'handle' => 'wp-commands',
- 'path' => 'commands/style',
- 'dependencies' => array('wp-components'),
- ),
array(
'handle' => 'wp-widgets',
'path' => 'widgets/style',
@@ -67,26 +67,26 @@ return array(
'path' => 'customize-widgets/style',
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-preferences', 'wp-widgets'),
),
- array(
- 'handle' => 'wp-edit-widgets',
- 'path' => 'edit-widgets/style',
- 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
- ),
array(
'handle' => 'wp-edit-post',
'path' => 'edit-post/style',
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-preferences', 'wp-widgets'),
),
array(
- 'handle' => 'wp-block-library',
- 'path' => 'block-library/style',
- 'dependencies' => array('wp-block-editor', 'wp-components', 'wp-patterns'),
+ 'handle' => 'wp-edit-widgets',
+ 'path' => 'edit-widgets/style',
+ 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
),
array(
'handle' => 'wp-editor',
'path' => 'editor/style',
'dependencies' => array('wp-block-editor', 'wp-commands', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences'),
),
+ array(
+ 'handle' => 'wp-block-library',
+ 'path' => 'block-library/style',
+ 'dependencies' => array('wp-block-editor', 'wp-components', 'wp-patterns'),
+ ),
array(
'handle' => 'wp-block-editor',
'path' => 'block-editor/style',
diff --git a/wp-includes/js/dist/script-modules/index.php b/wp-includes/js/dist/script-modules/index.php
index 3fe0e32738..169c95a7e1 100644
--- a/wp-includes/js/dist/script-modules/index.php
+++ b/wp-includes/js/dist/script-modules/index.php
@@ -22,6 +22,11 @@ return array(
'path' => 'latex-to-mathml/loader',
'asset' => 'latex-to-mathml/loader.min.asset.php',
),
+ array(
+ 'id' => '@wordpress/abilities',
+ 'path' => 'abilities/index',
+ 'asset' => 'abilities/index.min.asset.php',
+ ),
array(
'id' => '@wordpress/interactivity-router',
'path' => 'interactivity-router/index',
@@ -32,11 +37,6 @@ return array(
'path' => 'interactivity-router/full-page',
'asset' => 'interactivity-router/full-page.min.asset.php',
),
- array(
- 'id' => '@wordpress/abilities',
- 'path' => 'abilities/index',
- 'asset' => 'abilities/index.min.asset.php',
- ),
array(
'id' => '@wordpress/a11y',
'path' => 'a11y/index',
@@ -47,16 +47,16 @@ return array(
'path' => 'core-abilities/index',
'asset' => 'core-abilities/index.min.asset.php',
),
- array(
- 'id' => '@wordpress/edit-site-init',
- 'path' => 'edit-site-init/index',
- 'asset' => 'edit-site-init/index.min.asset.php',
- ),
array(
'id' => '@wordpress/route',
'path' => 'route/index',
'asset' => 'route/index.min.asset.php',
),
+ array(
+ 'id' => '@wordpress/edit-site-init',
+ 'path' => 'edit-site-init/index',
+ 'asset' => 'edit-site-init/index.min.asset.php',
+ ),
array(
'id' => '@wordpress/lazy-editor',
'path' => 'lazy-editor/index',
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index e1d9c9b904..89ef4acf73 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -3488,7 +3488,7 @@ function wp_enqueue_command_palette_assets() {
* 'sayHello();' === wp_remove_surrounding_empty_script_tags( $js );
*
* // Otherwise if anything is different it warns in the JS console.
- * $js = '<script type="text/javascript">console.log( "hi" );</script>';
+ * $js = '<script type="module">console.log( "hi" );</script>';
* 'console.error( ... )' === wp_remove_surrounding_empty_script_tags( $js );
*
* @since 6.4.0
diff --git a/wp-includes/theme-previews.php b/wp-includes/theme-previews.php
index 8297dca0a2..287559c984 100644
--- a/wp-includes/theme-previews.php
+++ b/wp-includes/theme-previews.php
@@ -69,7 +69,7 @@ function wp_attach_theme_preview_middleware() {
function wp_block_theme_activate_nonce() {
$nonce_handle = 'switch-theme_' . wp_get_theme_preview_path();
?>
- <script type="text/javascript">
+ <script>
window.WP_BLOCK_THEME_ACTIVATE_NONCE = <?php echo wp_json_encode( wp_create_nonce( $nonce_handle ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>;
</script>
<?php
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index 0ff915cbe4..e22e3c236f 100644
--- a/wp-includes/theme.php
+++ b/wp-includes/theme.php
@@ -1893,11 +1893,9 @@ function _custom_background_cb() {
$color = false;
}
- $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
-
if ( ! $background && ! $color ) {
if ( is_customize_preview() ) {
- printf( '<style%s id="custom-background-css"></style>', $type_attr );
+ echo '<style id="custom-background-css"></style>';
}
return;
}
@@ -1951,7 +1949,7 @@ function _custom_background_cb() {
$style .= $image . $position . $size . $repeat . $attachment;
}
- $processor = new WP_HTML_Tag_Processor( "<style{$type_attr} id=\"custom-background-css\"></style>" );
+ $processor = new WP_HTML_Tag_Processor( '<style id="custom-background-css"></style>' );
$processor->next_tag();
$style_tag_content = 'body.custom-background { ' . trim( $style ) . ' }';
@@ -1972,9 +1970,6 @@ function wp_custom_css_cb() {
$processor = new WP_HTML_Tag_Processor( '<style></style>' );
$processor->next_tag();
- if ( ! current_theme_supports( 'html5', 'style' ) ) {
- $processor->set_attribute( 'type', 'text/css' );
- }
$processor->set_attribute( 'id', 'wp-custom-css' );
$processor->set_modifiable_text( "\n{$styles}\n" );
echo "{$processor->get_updated_html()}\n";
@@ -3006,11 +3001,9 @@ function _custom_logo_header_styles() {
$classes = (array) get_theme_support( 'custom-logo', 'header-text' );
$classes = array_map( 'sanitize_html_class', $classes );
$classes = '.' . implode( ', .', $classes );
-
- $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
?>
<!-- Custom Logo: hide header text -->
- <style id="custom-logo-css"<?php echo $type_attr; ?>>
+ <style id="custom-logo-css">
<?php echo $classes; ?> {
position: absolute;
clip-path: inset(50%);
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 0103d4950b..774599b90b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61439';
+$wp_version = '7.0-alpha-61440';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.