Remove slugs from custom posts type

if ( ! in_array( $post->post_type, array( 'internal_doors' ) ) || 'publish' != $post->post_status )

replace above with

 if ( ! in_array( $post->post_type, array( 'internal_doors','custom post type name1', 'custom post type name2' ) ) || 'publish' != $post->post_status )

and

if ( ! empty( $query->query['name'] ) )
        $query->set( 'post_type', array( 'post', 'internal_doors', 'page' ) );

replace this with

if ( ! empty( $query->query['name'] ) )
        $query->set( 'post_type', array( 'post', 'internal_doors','custom post type name1', 'custom post type name2', 'page' ) );

note: change custom post type name1, custom post type name2 with your original names