Weak mixing implies weak mixing of higher orders along tempered functions