mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@46164 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1000,8 +1000,9 @@ function enqueue_embed_scripts() {
|
||||
* @since 4.4.0
|
||||
*/
|
||||
function print_embed_styles() {
|
||||
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
|
||||
?>
|
||||
<style type="text/css">
|
||||
<style<?php echo $type_attr; ?>>
|
||||
<?php
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );
|
||||
@@ -1031,8 +1032,9 @@ function print_embed_styles() {
|
||||
* @since 4.4.0
|
||||
*/
|
||||
function print_embed_scripts() {
|
||||
$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<script<?php echo $type_attr; ?>>
|
||||
<?php
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );
|
||||
|
||||
Reference in New Issue
Block a user