replacing db interaction with wordpress available functions