Update template-functions.php

Sanitize purchase link form ID and class attribute usage as proposed on https://wordpress.org/support/topic/duplicate-ids-with-multiple-checkoutbuy-buttons