Make WordPress Core


Ignore:
Timestamp:
01/05/2026 04:02:03 PM (2 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/admin-header.php

    r59698 r61440  
    102102$admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix );
    103103?>
    104 <script type="text/javascript">
     104<script>
    105105addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    106106var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
     
    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>
Note: See TracChangeset for help on using the changeset viewer.