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/media.php

    r46078 r46164  
    19451945     */
    19461946    if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
     1947        $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
     1948
    19471949        $gallery_style = "
    1948         <style type='text/css'>
     1950        <style{$type_attr}>
    19491951            #{$selector} {
    19501952                margin: auto;
Note: See TracChangeset for help on using the changeset viewer.