It’s been less than a year since I first published my B2Template plugin to help people start building their own plugins for WordPress. I received some great feedback and so I’ve updated the plugin to address some new features in WordPress 3, and improve on some of the methods I took in the previous version. The new version of the B2Template Plugin is available from the WordPress Plugin directory. The plugin has been commented to within an inch of its life, and is hopefully laid out in a way that is easy to follow.

This plugin covers the following topics:

  • Creating a Plugin within a class structure to better encapsulate your plugin and avoid conflicts with other plugins
  • Creating actions and filters
  • Creating an install script that runs on plugin activation and deactivation, and also performing the important step of removing all traces of your plugin upon deletion.
  • Internationalizing your plugin so that it can be translated by the WordPress community, and also how to create language files
  • Creating administration pages, registering settings, saving settings, properly loading JavaScript and CSS into admin pages, adding a link to the plugins settings page on the plugin activation page.
  • Using action and filters
  • Executing actions with and without Ajax from user-facing and admin-facing pages in a clean consistent manner.
  • How to load Ajax Elements
  • Registering and creating a WordPress 3.0 multi-widget
  • Interacting with the database, proper input sanitization
  • Returning error messages to the user with the WP_Error object

Please check out the plugin and let me know if you find it helpful, or if you can think of ways in which it can be improved.

Download the B2Template Plugin 2.0 from the WordPress Plugin Directory.