Skip to content

Instantly share code, notes, and snippets.

@vfontjr
Last active December 14, 2018 09:26
Show Gist options
  • Save vfontjr/31e442bc8608bc1775678ae208be1ee0 to your computer and use it in GitHub Desktop.
Save vfontjr/31e442bc8608bc1775678ae208be1ee0 to your computer and use it in GitHub Desktop.
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