Hi Sheenie,
Almost always, a widow will use her married name when marrying again. But I can't see any trace of a Staples marrying a Martha in tha area before 1805, on FreeREG or the North Somerset Marriages CD. However, I did notice that on the CD the Publow 1805 marriage is recorded as Joseph Sheppard and Martha STOKES, Widow! But I can't see a marriage of Martha to a Stokes either

Which is odd as there are baptisms for children of Joseph and Martha Stokes in Publow and a burial for Joseph Stokes in 1804. But unfortunately the baptisms were in 1803 and 1810, which rules that Martha out unless the 1810 is another mistake or there were two Joseph and Marthas.
The burials at Publow would seem to tie in nicely. The Elizabeth baptised in Bath was born 27 August 1815 so would be just under 19 months if buried 23 Mar 1817, fitting exactly. Her baptism entry also records that she was born in Weston (on the edge of Bath) and that her mother's maiden name was Thomson. There was a Martha Thomson baptised at Publow in 1777. She'd be 40 in 1817, fitting with the burial of Martha Sheppard. Definitely looks like you are on the right track assuming all those extracts refer to the same family.
David
PS Just found Martha Thomson married Joseph Stoakes at St. Paul's, Bristol on 17 Mar 1800.