@@ -100,37 +100,12 @@ class WP_Styles extends WP_Dependencies {
100100 */
101101 public $ default_dirs ;
102102
103- /**
104- * Holds a string which contains the type attribute for style tag.
105- *
106- * If the active theme does not declare HTML5 support for 'style',
107- * then it initializes as `type='text/css'`.
108- *
109- * @since 5.3.0
110- * @var string
111- */
112- private $ type_attr = '' ;
113-
114103 /**
115104 * Constructor.
116105 *
117106 * @since 2.6.0
118107 */
119108 public function __construct () {
120- if (
121- (
122- function_exists ( 'is_admin ' ) &&
123- ! is_admin ()
124- )
125- &&
126- (
127- function_exists ( 'current_theme_supports ' ) &&
128- ! current_theme_supports ( 'html5 ' , 'style ' )
129- )
130- ) {
131- $ this ->type_attr = " type='text/css' " ;
132- }
133-
134109 /**
135110 * Fires when the WP_Styles instance is initialized.
136111 *
@@ -179,9 +154,8 @@ public function do_item( $handle, $group = false ) {
179154
180155 if ( $ inline_style ) {
181156 $ inline_style_tag = sprintf (
182- "<style id='%s-inline-css'%s > \n%s \n</style> \n" ,
157+ "<style id='%s-inline-css'> \n%s \n</style> \n" ,
183158 esc_attr ( $ handle ),
184- $ this ->type_attr ,
185159 $ inline_style
186160 );
187161 } else {
@@ -227,12 +201,11 @@ public function do_item( $handle, $group = false ) {
227201 $ title = isset ( $ obj ->extra ['title ' ] ) ? $ obj ->extra ['title ' ] : '' ;
228202
229203 $ tag = sprintf (
230- "<link rel='%s' id='%s-css'%s href='%s'%s media='%s' /> \n" ,
204+ "<link rel='%s' id='%s-css'%s href='%s' media='%s' /> \n" ,
231205 $ rel ,
232206 esc_attr ( $ handle ),
233207 $ title ? sprintf ( " title='%s' " , esc_attr ( $ title ) ) : '' ,
234208 $ href ,
235- $ this ->type_attr ,
236209 esc_attr ( $ media )
237210 );
238211
@@ -259,12 +232,11 @@ public function do_item( $handle, $group = false ) {
259232 }
260233
261234 $ rtl_tag = sprintf (
262- "<link rel='%s' id='%s-rtl-css'%s href='%s'%s media='%s' /> \n" ,
235+ "<link rel='%s' id='%s-rtl-css'%s href='%s' media='%s' /> \n" ,
263236 $ rel ,
264237 esc_attr ( $ handle ),
265238 $ title ? sprintf ( " title='%s' " , esc_attr ( $ title ) ) : '' ,
266239 $ rtl_href ,
267- $ this ->type_attr ,
268240 esc_attr ( $ media )
269241 );
270242
@@ -360,9 +332,8 @@ public function print_inline_style( $handle, $display = true ) {
360332 }
361333
362334 printf (
363- "<style id='%s-inline-css'%s > \n%s \n</style> \n" ,
335+ "<style id='%s-inline-css'> \n%s \n</style> \n" ,
364336 esc_attr ( $ handle ),
365- $ this ->type_attr ,
366337 $ output
367338 );
368339
0 commit comments