One really great way to teach yourself how to do something… is to do it.
The next best way is to learn from really simple examples that you can quickly master.
Since I do really well learning by doing, I thought to share fruits of my labor with others who appreciate airtight, accurate examples.
Thus, I present a suite of very, very simple plugins, each examining one aspect of WordPress plugin programming, and accomplishing… absolutely nothing at all! But if you use these plugins as building blocks for your own work, your plugin construction will proceed much faster.
Check these out:
- Demo Plugin i18n: Once you understand how this plugin works, you are 90% on your way to internationalizing your own plugins.
- Demo Plugin Options: Ever wonder how those cool options pages are created? Wonder no more. This plugin will let you set options. In fact, that’s all it will let you do!
- Make your very own plugin menu with Demo Plugin Menu. It’s not difficult, and you can even have a little icon on you menu.
- Demo Plugin Database: Adding a database table for your plugins convenience is not very difficult, once you see it done. With this plugin, it’s all you will see done.
- Demo Plugin Paths: Do all those variations and combinations in __FILE__, dirname, basename, etc. confuse you as much as they do me? Be confused no more. The Demo Paths plugin simply lists each common variation out in it’s administration page for you to peruse any time your confusion reigns. I can’t program WordPress without this plugin!
These tiny demonstration plugins were inspired by the B2Template plugin, which you should install as well. These plugins complement B2Template perfectly: where B2Template takes a “top down” approach of putting all the dummy code into one plugin, the Website In A Weekend approach is bottom up.
Using top down, you customize and replace existing B2Template functions, stripping out what you don’t need.
Using bottom up, choose only the plugins you need to use, and add them together, changing the example names as necessary.
Have fun, and leave a comment if you have any questions.
[sniplet more-plugins]

