Wolves striker Leigh Griffiths has agreed a new two-year contract with the League One club, with the option of a third year.