diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index c16ffc99a1..19d668c633 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -1117,8 +1117,9 @@ function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) { * @since 3.1.0 */ function wp_admin_bar_header() { + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; ?> - + media="print">#wpadminbar { display:none; } -\n", esc_attr( $handle ), $inline_style ); + $inline_style_tag = sprintf( + "\n", + esc_attr( $handle ), + $this->type_attr, + $inline_style + ); } else { $inline_style_tag = ''; } @@ -197,9 +217,17 @@ class WP_Styles extends WP_Dependencies { } $rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; - $title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : ''; + $title = isset( $obj->extra['title'] ) ? sprintf( "title='%s'", esc_attr( $obj->extra['title'] ) ) : ''; - $tag = "\n"; + $tag = sprintf( + "\n", + $rel, + $handle, + $title, + $href, + $this->type_attr, + $media + ); /** * Filters the HTML link tag of an enqueued style. @@ -223,7 +251,16 @@ class WP_Styles extends WP_Dependencies { $rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" ); } - $rtl_tag = "\n"; + $rtl_tag = sprintf( + "\n", + $rel, + $handle, + $title, + $rtl_href, + $this->type_attr, + $media + ); + /** This filter is documented in wp-includes/class.wp-styles.php */ $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media ); @@ -298,7 +335,12 @@ class WP_Styles extends WP_Dependencies { return $output; } - printf( "\n", esc_attr( $handle ), $output ); + printf( + "\n", + esc_attr( $handle ), + $this->type_attr, + $output + ); return true; } diff --git a/wp-includes/embed.php b/wp-includes/embed.php index c46b4b1cec..06e4472e44 100644 --- a/wp-includes/embed.php +++ b/wp-includes/embed.php @@ -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"'; ?> - \n"; } diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 730ff902d6..e4cc8802f5 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -702,7 +702,14 @@ function locale_stylesheet() { if ( empty( $stylesheet ) ) { return; } - echo ''; + + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; + + printf( + '', + $stylesheet, + $type_attr + ); } /** @@ -1641,7 +1648,8 @@ function _custom_background_cb() { if ( ! $background && ! $color ) { if ( is_customize_preview() ) { - echo ''; + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; + printf( '', $type_attr ); } return; } @@ -1693,9 +1701,11 @@ function _custom_background_cb() { $attachment = " background-attachment: $attachment;"; $style .= $image . $position . $size . $repeat . $attachment; + + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; } ?> - } function wp_custom_css_cb() { $styles = wp_get_custom_css(); if ( $styles || is_customize_preview() ) : + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; ?> - - - .recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}', + $type_attr + ); } /**