the_author_posts_link
“Displays a link to all posts by an author.” That is, the function echo
s content. It does not return the content for use by some other function.
You won’t be able to use that function, but you should be able to use it as a model for your own function for generating and return
ing the link instead of echo
ing it.