Added the functionality to edit posts