Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove "type" from script/style Tags
<?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