Can’t set properly WordPress add_filter function

Here’s the solution!

function woocompare_button_icon( $html, $classes, $id, $nonce, $text, $preloader )
{
    return sprintf( '<button type="button" class="%s" data-id="%s" data-nonce="%s"><i class="fa fa-heart-o" aria-hidden="true"></i> %s</button>', implode( ' ', $classes ), $id, $nonce, $text . $preloader );
}

add_filter( 'tm_woocompare_button', 'woocompare_button_icon', 10, 6);