Forums Forums General Validation Warnings

Viewing 2 posts - 1 through 2 (of 2 total)
  • Trevor
    #199203

    I have a feeling this is WordPress doing this, as we simply enqueue the files (but I could be wrong). This post might help you:

    https://www.lee-harris.co.uk/blog/remove-type-attribute-script-tags-wordpress/

    Trevor
    #199205

    As a follow up, this is the code that would need to go in to your child theme’s functions.php file:

    add_action( 'template_redirect', function(){
        ob_start( function( $buffer ){
            $buffer = str_replace( array( 'type="text/javascript"', "type='text/javascript'" ), '', $buffer );
            return $buffer;
        });
    });

    You could use this in other ways:

    $buffer = str_replace( array( 'type="text/css"', "type='text/css'" ), '', $buffer );
    $buffer = str_replace( array( 'frameborder="0"', "frameborder='0'" ), '', $buffer );
    $buffer = str_replace( array( 'scrolling="no"', "scrolling='no'" ), '', $buffer );
Viewing 2 posts - 1 through 2 (of 2 total)