Guest User

Remove type from script/style tags

a guest
Nov 15th, 2018
142
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2);
  2. add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2);
  3. function codeless_remove_type_attr($tag, $handle) {
  4. return preg_replace( "/ type=['\"]text\/(javascript|css)['\"]/", '', $tag );
  5. }
RAW Paste Data