type attributes
-
hello autoptimize cant remove my type=’text/javascript’ how can i fix it because the validator.w3.org says Warning: The type attribute is unnecessary for JavaScript resources. thanks a lot
is this right ?
// Remove ‘type’ attribute of scripts and styles
if ( ! function_exists( ‘prefix_remove_type_attr’ ) ) {
function prefix_remove_type_attr( $tag ) {
return preg_replace( “/type=[‘\”]text\/(javascript|css)[‘\”]/”, ”, $tag );
}add_filter( ‘style_loader_tag’, ‘prefix_remove_type_attr’, 10 );
add_filter( ‘script_loader_tag’, ‘prefix_remove_type_attr’, 10 );
add_filter( ‘autoptimize_html_after_minify’, ‘prefix_remove_type_attr’, 10 ); // ‘Autoptimize’ plugin support}
The page I need help with: [log in to see the link]
- The topic ‘type attributes’ is closed to new replies.