Description: It seems like only yesterday, I set out to build my first ever WordPress Plug-in. Bright eyed and bushy tailed, I poured over the WordPress Codex, putting together the pieces of the process until I finally got the big picture. The WordPress Codex is an amazing resource for anyone looking to get into WordPress development; I strongly recommend any new developer read through the "Writing a Plugin" section.
While learning, I had a difficult time finding a straightforward template I could use as a base for my plug-ins. I wanted something that was clean and well-organized but also provided examples of more complex behaviours, such as: Internationalization, Widgets and Front and Back-End Ajax. I wanted to ensure my plug-in functionality was encapsulated inside a class structure so my functions and variables wouldn't conflict with the WordPress Core, or other plug-ins.
I've finally gotten around to writing this template plug-in, and I thought I would share it with the community to get your feedback and improvements, and hopefully save new developers some time.
1. Download the template plug-in.
2. Place the files in the plug-ins directory of your development installation of WordPress.
3. Come up with a unique name for your plug-in, such as MyPlugin. Check the 4. WordPress Plug-in directory to ensure this name hasn't been used.
4. Rename the plug-in folder from B2Template to your plug-in name (i.e. MyPlugin). Do not use spaces or special characters.
5. Rename the file B2Template.php to MyPlugin.php
6. Rename the file B2Template.class.php to MyPlugin.class.php
7. Rename the class inside MyPlugin.class.php from B2Template to MyPlugin
8. Rename the constructor function inside MyPlugin.class.php from B2Template() to MyPlugin()
9. Activate the plugin from the WordPress Plugin Administration Panel
10. Add the Template widget to your sidebar from the WordPress Appearance Administration Panel
11. View your site, and interact with the widget to observe it's behaviour
12. From the WordPress Administration page, click on Settings, and select MyPlugin.
13. Interact with the plugin from this page, to view its behaviour.
Related: Wordpress, Plugin, myplugin, Rename, inside, Template, mypluginclassphp, Administration, wanted, Plugins, behaviour, ensure, Panel, Directory, Development, Widget, Class, codex
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB