Problem is … when I click on edit post/edit page, it tries to open http://localhost/site/wp-admin/post-108.php?post=286&action=edit and ends up on 404 page.
It also shows the 404 page when saving a new post/page.
I don’t remember exactly what I did but it must have started after my IDE refactored the code when I was renaming a template file.
There is no post-108.php inside wp-admin folder or inside my theme folder, but there’s post.php. I don’t know why it is trying to open post-108.php which does not exist.
NOTE: It is a custom theme I am building myself using wordpress 4.7.4
Thank you all.
Read more here: WordPress shows 404 page when saving new post or editing post