The idea of the poisoned cake was probably inspired by Barrie, who also had a cake in his version, although neither poisoned nor specifically intended for Peter. In the novel and play (Chapter VII and Act II, respectively), Hook devised a plan whereby the pirates prepared "a large rich cake of a jolly thickness with green sugar on it" to leave on the shore of Mermaids' Lagoon, hoping that the Lost Boys, "having no mother, would not know how dangerous 'tis to eat rich damp cake", and thus would perish. Needless to say, the plan didn't work, because Wendy found it and hid it from the boys.
At least the cake fits in with Barrie's story, unlike Disney who had Hook leave a time bomb...