fix error with undefined method wpDb by setting the hash before the block

Signed-off-by: Tass Skoudros <tass@skystack.com>