Last active
December 14, 2018 09:26
-
-
Save vfontjr/31e442bc8608bc1775678ae208be1ee0 to your computer and use it in GitHub Desktop.
Remove "type" from script/style Tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2); | |
add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2); | |
function codeless_remove_type_attr($tag, $handle) { | |
return preg_replace('/ type=[\'"]text\/(javascript|css)[\'"]/', '', $tag ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment