Make WordPress Core


Ignore:
Timestamp:
01/05/2026 04:02:03 PM (9 months ago)
Author:
jonsurrell
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r61412 r61440  
    21392139        wp_enqueue_style( 'colors' );
    21402140        ?>
    2141 <script type="text/javascript">
     2141<script>
    21422142addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    21432143function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
    … …  
    21882188        ?>
    21892189<body <?php echo $admin_body_id; ?>class="wp-admin wp-core-ui no-js iframe <?php echo esc_attr( $admin_body_classes ); ?>">
    2190 <script type="text/javascript">
     2190<script>
    21912191(function(){
    21922192var c = document.body.className;
    … …  
    22272227        ?>
    22282228        </div>
    2229 <script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
     2229<script>if(typeof wpOnload==='function')wpOnload();</script>
    22302230</body>
    22312231</html>
    … …  
    24962496function compression_test() {
    24972497        ?>
    2498         <script type="text/javascript">
     2498        <script>
    24992499        var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?>;
    25002500        var testCompression = {
Note: See TracChangeset for help on using the changeset viewer.