Checking whether post is deleted or saved in edit_post

That hook is fired after a post is updated. When a post is sended to trash, technically is a post_status change, so it’s an update and so the hook is fired.

When you want to target post status change better choice are post status transitions hooks, e.g. to target a post trash use:

add_action( 'transition_post_status', 'fired_on_post_change_staus', 10, 3 );

function fired_on_post_change_staus( $new_status, $old_status, $post ) {
   if ( $new_status == 'trash' ) {
        // Do something when post is deleted
   }
}

However, when a post is updated, the post status can stay the same, in this case you can use the edit_post post hook. Once this hook is fired after an update is performed and it pass the post object as second argument you can check the actual post status, e.g.

add_action( 'edit_post', 'fired_on_post_edit', 10, 2 );

function fired_on_post_edit( $post_ID, $post ) {
   if ( $post->post_status != 'trash' ) {
        // Do something when post is updated but not deleted
   }
}

A more granular control can be reached using post_updated hook, that is similar to the previous, but pass how post was before the update and how is after, e.g.

add_action( 'post_updated', 'fired_on_post_edit_2', 10, 3 );

function fired_on_post_edit_2( $post_ID, $post_after, $post_before ) {
   if ( $post_after->post_status == 'trash' && $post_before->post_status == 'publish' ) {
        // Do something when post is trashed after being published
   }
   if ( $post_after->post_status == 'publish' && $post_before->post_status == 'trash' ) {
        // Do something when post is published after being trash (post undelete)
   }
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)