Sample code from the book Creating Wordpress Plugins: A Step by Step Guide