How to cancel the trash action inside wp_trash_post

It’s possible to utilize the pre_delete_post filter to short-circuit the deleting of posts.

add_filter( 'pre_delete_post', 'wpse_224246_pre_delete_post', 10, 3 );
function wpse_224246_pre_delete_post( $delete, $post, $force_delete ) {
  //* Escape early if post isn't already trashed
  if( 'trash' !== $post->post_status ) {
    return $delete;
  }
  //* Go ahead with deleting the post if the current user is the post author 
  if( get_current_user_id() === $post->post_author ) {
    return $delete;
  }
  //* Returning any other value besides null will short circuit the deletion
  return true;
}