Skip to content

Commit 80ae9e6

Browse files
sirrealaaronjorbin
authored andcommitted
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 WordPress#10664. Follow-up to [61411], [46164]. Props jonsurrell, sabernhardt, westonruter. Fixes #64428. See #59883, #64442. git-svn-id: https://develop.svn.wordpress.org/trunk@61440 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3a99c94 commit 80ae9e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+72
-79
lines changed

src/readme.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<meta name="robots" content="noindex,nofollow" />
77
<title>WordPress &#8250; ReadMe</title>
8-
<link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" type="text/css" />
8+
<link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" />
99
</head>
1010
<body>
1111
<h1 id="logo">

src/wp-admin/admin-footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@
114114
?>
115115

116116
<div class="clear"></div></div><!-- wpwrap -->
117-
<script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
117+
<script>if(typeof wpOnload==='function')wpOnload();</script>
118118
</body>
119119
</html>

src/wp-admin/admin-header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102
$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
103103
?>
104-
<script type="text/javascript">
104+
<script>
105105
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();}}};
106106
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
107107
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
@@ -253,7 +253,7 @@
253253
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
254254
?>
255255
<body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>">
256-
<script type="text/javascript">
256+
<script>
257257
document.body.className = document.body.className.replace('no-js','js');
258258
</script>
259259

src/wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
?>
160160
<title><?php echo esc_html( $admin_title ); ?></title>
161161

162-
<script type="text/javascript">
162+
<script>
163163
var ajaxurl = <?php echo wp_json_encode( admin_url( 'admin-ajax.php', 'relative' ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>,
164164
pagenow = 'customize';
165165
</script>

src/wp-admin/edit-form-advanced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@
769769
?>
770770

771771
<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
772-
<script type="text/javascript">
772+
<script>
773773
try{document.post.title.focus();}catch(e){}
774774
</script>
775775
<?php endif; ?>

src/wp-admin/edit-form-comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
</form>
284284

285285
<?php if ( ! wp_is_mobile() ) : ?>
286-
<script type="text/javascript">
286+
<script>
287287
try{document.post.name.focus();}catch(e){}
288288
</script>
289289
<?php

src/wp-admin/edit-tag-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
</div>
313313

314314
<?php if ( ! wp_is_mobile() ) : ?>
315-
<script type="text/javascript">
315+
<script>
316316
try{document.forms.edittag.name.focus();}catch(e){}
317317
</script>
318318
<?php

src/wp-admin/edit-tags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@
689689
</div><!-- /wrap -->
690690

691691
<?php if ( ! wp_is_mobile() ) : ?>
692-
<script type="text/javascript">
692+
<script>
693693
try{document.forms.addtag['tag-name'].focus();}catch(e){}
694694
</script>
695695
<?php

src/wp-admin/export.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
function export_add_js() {
2828
?>
29-
<script type="text/javascript">
29+
<script>
3030
jQuery( function($) {
3131
var form = $('#export-filters'),
3232
filters = form.find('.export-filters');

src/wp-admin/includes/class-bulk-upgrader-skin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function error( $errors ) {
141141
}
142142
$this->error = implode( ', ', $messages );
143143
}
144-
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
144+
echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
145145
}
146146

147147
/**
@@ -172,7 +172,7 @@ public function bulk_footer() {
172172
public function before( $title = '' ) {
173173
$this->in_loop = true;
174174
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 );
175-
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
175+
echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').css("display", "inline-block");</script>';
176176
// This progress messages div gets moved via JavaScript when clicking on "More details.".
177177
echo '<div class="update-messages hide-if-js" id="progress-' . esc_attr( $this->upgrader->update_current ) . '"><p>';
178178
$this->flush_output();
@@ -200,7 +200,7 @@ public function after( $title = '' ) {
200200
)
201201
);
202202

203-
echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
203+
echo '<script>jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
204204
}
205205
if ( $this->result && ! is_wp_error( $this->result ) ) {
206206
if ( ! $this->error ) {
@@ -210,7 +210,7 @@ public function after( $title = '' ) {
210210
'</p></div>';
211211
}
212212

213-
echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
213+
echo '<script>jQuery(\'.waiting-' . esc_js( $this->upgrader->update_current ) . '\').hide();</script>';
214214
}
215215

216216
$this->reset();

0 commit comments

Comments
 (0)