Make WordPress Core


Ignore:
Timestamp:
12/26/2025 01:14:22 PM (9 months ago)
Author:
jonsurrell
Message:

Scripts: Remove default type attribute 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/10658.

Follow-up to [46164].

Props hardikhuptechdev, jonsurrell, dmsnell, westonruter.
Fixes #64428. See #59883, #64442.

File:
1 edited

Legend:

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

    r60995 r61411  
    734734        }
    735735
    736         $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
    737 
    738736        printf(
    739                 '<link rel="stylesheet" href="%s"%s media="screen" />',
    740                 $stylesheet,
    741                 $type_attr
     737                '<link rel="stylesheet" href="%s" media="screen" />',
     738                $stylesheet
    742739        );
    743740}
Note: See TracChangeset for help on using the changeset viewer.