I have used $this->add_error method in my validation code but in get_errors() i am getting empty values ...or is there any other way to get all the errors?
So based on the errors i will process the saved data.
The on_after_post hook happens after the save and is also when the image processing of uploaded files happens. So if you need to run image validation before saving, then you'll need to create an on_before_validate hook to process/validate the image. If there is an error, then the add_error method should prevent it from saving at that point.
Comments
So based on the errors i will process the saved data.