WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/18/2019 02:49:30 PM (9 months ago)
Author:
SergeyBiryukov
Message:

Script Loader: Introduce HTML5 support for scripts and styles.

When a theme declares HTML5 support for script and styles via add_theme_support( 'html5', array( 'script', 'style' ) ), the type="text/javascript" and type="text/css" attributes are omitted.

These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.

Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See #42804.

File:
1 edited

Legend:

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

    r45932 r46164  
    11181118 */
    11191119function wp_admin_bar_header() {
     1120    $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
    11201121    ?>
    1121 <style type="text/css" media="print">#wpadminbar { display:none; }</style>
     1122<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
    11221123    <?php
    11231124}
     
    11291130 */
    11301131function _admin_bar_bump_cb() {
    1131 
     1132    $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
    11321133    ?>
    1133 <style type="text/css" media="screen">
     1134<style<?php echo $type_attr; ?> media="screen">
    11341135    html { margin-top: 32px !important; }
    11351136    * html body { margin-top: 32px !important; }
Note: See TracChangeset for help on using the changeset viewer.