An example extension for Theater for WordPress that you can use to write your own extension.