Use the Transients API to List the Latest Commenter

The Transients API is a WordPress feature that I had never heard of until a few weeks ago, when I wrote a post on getting your Twitter follower count in plain text.
On that post, Otto left a comment with a different way of getting the same result, using the Transients API. Instead of using cron, which can be complicated, transients allow you to use just one or two lines.
In this post, I want to show you how to use transients, and to do that, we’re going to build a simple script that will list the latest commenter on your blog, along with their avatar. The end result will look like the image above.


48