Never remove media attribute on link tags

This commit is contained in:
Louis-Rémi Babé
2013-05-14 19:02:09 +03:00
parent 2b0e5f5420
commit ecfaefd751

View File

@@ -94,17 +94,6 @@ function roots_wp_title($title) {
}
add_filter('wp_title', 'roots_wp_title', 10);
/**
* Clean up output of stylesheet <link> tags
*/
function roots_clean_style_tag($input) {
preg_match_all("!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches);
// Only display media if it's print
$media = $matches[3][0] === 'print' ? ' media="print"' : '';
return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
}
add_filter('style_loader_tag', 'roots_clean_style_tag');
/**
* Add and remove body_class() classes
*/