Recently I stumbled upon the following use case:

On my single-authors.php page (the detail page for an author), I wanted to showcase all the posts written by that author. (Note I created a custom post for author rather than using WordPress users since none of the authors log in to WordPress.)

To achieve this, I added the following to my functions.php: